[Piglit] [PATCH] shader_runner: fix uniform array name lookups
imirkin at alum.mit.edu
Wed Mar 4 07:28:10 PST 2015
On Wed, Mar 4, 2015 at 10:15 AM, Arthur Huillet <arthur.huillet at free.fr> wrote:
> On 2015-03-04 15:58, Ilia Mirkin wrote:
>> On Wed, Mar 4, 2015 at 4:53 AM, Arthur Huillet <arthur.huillet at free.fr>
>>> From: Arthur Huillet <ahuillet at nvidia.com>
>>> Don't look up uniform names for non-zero array elements, as this is
>>> illegal per GL4.5.
>>> From the discussion of GetProgramResourceIndex in the GL4.5 spec:
>>> 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
>>> "" 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"), a name identifying any array
>>> element other than
>>> the first (e.g., "a") is not considered to match.
>> Hm, and the spec goes on to define GetUniformIndices in terms of
>> What does this say about a.b.c ? Do they all have to be 0
>> and you have to retrieve all 3 strides? If so, your implementation
>> isn't quite doing that.
> Sorry, I should have mentioned that this only applies to bottom-level
> arrays, per the following in glspec45.compatibility.pdf:
> "For an active variable declared as an array of basic types (e.g. not an
> of stuctures or an array of arrays), a single entry will be generated, with
> name string formed by concatenating the name of the array and the string
> So as far as I can tell my change matches the spec requirements and the
> NVIDIA implementation.
Ah I see. That compat spec snippet is a *lot* clearer. Dare I ask what
happens when you do have an array of arrays, e.g. float a. I
believe Timothy Arceri is slowly working on that in mesa, so let's try
not to break that in the process.
More information about the Piglit