[Mesa-dev] [Bug 93731] glUniformSubroutinesuiv segfaults when subroutine uniform is bound to a specific location

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Jan 15 16:02:00 PST 2016


https://bugs.freedesktop.org/show_bug.cgi?id=93731

            Bug ID: 93731
           Summary: glUniformSubroutinesuiv segfaults when subroutine
                    uniform is bound to a specific location
           Product: Mesa
           Version: 11.0
          Hardware: x86-64 (AMD64)
                OS: Linux (All)
            Status: NEW
          Severity: normal
          Priority: medium
         Component: Mesa core
          Assignee: mesa-dev at lists.freedesktop.org
          Reporter: nioko1337 at googlemail.com
        QA Contact: mesa-dev at lists.freedesktop.org

Created attachment 121069
  --> https://bugs.freedesktop.org/attachment.cgi?id=121069&action=edit
fragment shader to test segfault

In GLSL, one can specify the location of a subroutine uniform by using
something like:
#extension GL_ARB_shader_subroutine : require
#extension GL_ARB_explicit_uniform_location : require
layout(location = 5) subroutine uniform color_t Color;

Assuming this is the only subroutine uniform, you should be able to set it's
value by calling:

UniformSubroutinesuiv(GL_FRAGMENT_SHADER, 6, &[0, 0, 0, 0, 0 ,
subroutin_index]);

According to the spec, the values [0]-[4] should be ignored, and the subroutine
uniform at location 5 should be set to `subroutin_index`.
Mesa will segfault when calling this function like that.

Unfortunately, I do not have a complete minimum example program right now (I'm
not good with raw opengl), but attached is a fragment shader which can be used
to reproduce the problem.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20160116/cd5bc038/attachment-0001.html>


More information about the mesa-dev mailing list