<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_ASSIGNED "
title="ASSIGNED - 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#c8">Comment # 8</a>
on <a class="bz_bug_link
bz_status_ASSIGNED "
title="ASSIGNED - 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">bug 90397</a>
from <span class="vcard"><a class="email" href="mailto:siglesias@igalia.com" title="Samuel Iglesias <siglesias@igalia.com>"> <span class="fn">Samuel Iglesias</span></a>
</span></b>
<pre>(In reply to Tapani Pälli from <a href="show_bug.cgi?id=90397#c7">comment #7</a>)
<span class="quote">> (In reply to Samuel Iglesias from <a href="show_bug.cgi?id=90397#c6">comment #6</a>)
> > (In reply to Tapani Pälli from <a href="show_bug.cgi?id=90397#c5">comment #5</a>)
> > > (In reply to Samuel Iglesias from <a href="show_bug.cgi?id=90397#c4">comment #4</a>)
> > > > I understand that this is referring to uniform/buffer variables but not
> > > > uniform/shader-storage blocks, but I might be wrong.
> > > >
> > > > I would like to have your opinion regarding if it is valid or not spec-wise.
> > > > What do you think?
> > > >
> > > > P.S: Attached to this, it's the patch that fixes this case.
> > >
> > > I'm somewhat surprised if this rule is not be common for all resources. The
> > > text in OpenGL Core 4.5 says (right below function declaration):
> > >
> > > "If name exactly matches the name string of one of the active resources for
> > > programInterface, the index of the matched resource is returned.
> > > Additionally, if
> > > name would exactly match the name string of an active resource if "[0]" were
> > > appended to name, the index of the matched resource is returned. Otherwise,
> > > name
> > > is considered not to be the name of an active resource, and INVALID_INDEX is
> > > returned.
> > >
> > > Note that if an interface enumerates a single active resource list entry for
> > > an array variable (e.g., "a[0]"), a name identifying any array element other
> > > than the first (e.g., "a[1]") is not considered to match."
> > >
> > > Just to make sure I understand correctly, when querying the index for
> > > fs_array_uniform_block[{1,2,3}] you are giving GL_UNIFORM as the interface?
> >
> > Nope, the interface type is GL_UNIFORM_BLOCK.
> >
> > Let me recapitulate, simplifying what I wrote:
> >
> > * I am querying the index for a <programInterface> equals to
> > GL_UNIFORM_BLOCK and for the following names ->
> > fs_array_uniform_block[{1,2,3}].
> >
> > * The OpenGL Core 4.5 spec snippet you pasted says the same than the
> > ARB_program_interface_query extension spec.
>
> Right, I just wanted to highlight this again as this explicitly states the
> rule and does not state that it would be valid only for some resource types.
> IMO it covers them all.
>
> > * As I said, NVIDIA doesn't give any error. Mesa returns INVALID_INDEX
> > because of valid_program_resource_index_name() function as, for each name,
> > the array index included in the name is not zero (in the example, they are
> > 1, 2 and 3).
>
> Could you attach or link to the modified Piglit test case? I'm wondering a
> bit if glGetProgramResourceName returns the name with array index and if so,
> why.</span >
>
I published a branch with the modified test, please see last commit:
git clone -b arb_uniform_buffer_object-patches
<a href="https://github.com/samuelig/piglit.git">https://github.com/samuelig/piglit.git</a>
File: tests/spec/arb_program_interface_query/resource-query.c</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the QA Contact for the bug.</li>
</ul>
</body>
</html>