<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - glUniformSubroutinesuiv segfaults when subroutine uniform is bound to a specific location"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=93731">93731</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>glUniformSubroutinesuiv segfaults when subroutine uniform is bound to a specific location
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>Mesa
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>11.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>x86-64 (AMD64)
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux (All)
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Mesa core
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>mesa-dev@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>nioko1337@googlemail.com
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>mesa-dev@lists.freedesktop.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=121069" name="attach_121069" title="fragment shader to test segfault">attachment 121069</a> <a href="attachment.cgi?id=121069&action=edit" title="fragment shader to test segfault">[details]</a></span>
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.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the QA Contact for the bug.</li>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>