<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 - ARB_program_interface_query: glGetProgramResourceiv() returns wrong value for GL_REFERENCED_BY_*_SHADER prop for GL_UNIFORM for members of an interface block with an instance name"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=90397">90397</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>ARB_program_interface_query: glGetProgramResourceiv() returns wrong value for GL_REFERENCED_BY_*_SHADER prop for GL_UNIFORM for members of an interface block with an instance name
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>git
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>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>siglesias@igalia.com
          </td>
        </tr>

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

        <tr>
          <th>CC</th>
          <td>lemody@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I was doing some testing of GL_BUFFER_VARIABLE <programInterface> parameter in
glGetProgramResourceiv() checking different property queries, because I need
that support for testing my GL_ARB_shader_storage_buffer_object work.

I realized that queries for GL_REFERENCED_BY_*_SHADER
(GL_REFERENCED_BY_VERTEX_SHADER, GL_REFERENCED_BY_FRAGMENT_SHADER...) are not
returning the proper value when the variable is a member of an interface block
with an instance name. This is happening to GL_UNIFORM in current master
branch.

For example: using the following vertex shader,
glGetProgramResourceiv(GL_REFERENCED_BY_VERTEX_SHADER) query for GL_UNIFORM's
"ubo_std140.s[0].b[0]" should return 1 but it returns 0. ATI proprietary driver
returns 1.

    #version 330
    #extension GL_ARB_uniform_buffer_object : require

    struct B {mat2 b[3]; float c;};
    layout(row_major, std140) uniform ubo_std140 {
        vec4 v;
        B s[2];
    } a_std140;

    in vec4 piglit_vertex;

    void main() {
        gl_Position = piglit_vertex;
        mat2 a = a_std140.s[0].b[0];
        gl_Position.x = a[0][0];
    }

Tested on Mesa master: abf3fefa1aa734844e0ca8e95e8c3a501909aa33</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>