main: Remove interface block array index for doing the name comparison
authorSamuel Iglesias Gonsalvez <siglesias@igalia.com>
Wed, 21 Oct 2015 12:34:29 +0000 (14:34 +0200)
committerSamuel Iglesias Gonsalvez <siglesias@igalia.com>
Tue, 27 Oct 2015 07:10:04 +0000 (08:10 +0100)
commit4565b6f4fb59d261f9128ffe91c0787af4b15ea4
treee2e6e1fe8a26f7a7682c818642794555f1e4ff67
parent3359ad6cda49fb977d837eb00e8ae4d781d95c2a
main: Remove interface block array index for doing the name comparison

From ARB_program_query_interface spec:

"uint GetProgramResourceIndex(uint program, enum programInterface,
                                   const char *name);
 [...]
 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. [...]"

"A string provided to GetProgramResourceLocation or
 GetProgramResourceLocationIndex is considered to match an active variable
 if:
[...]
   * if the string identifies the base name of an active array, where the
     string would exactly match the name of the variable if the suffix
     "[0]" were appended to the string;
[...]
"

Fixes the following two dEQP-GLES31 tests:

dEQP-GLES31.functional.program_interface_query.shader_storage_block.resource_list.block_array
dEQP-GLES31.functional.program_interface_query.shader_storage_block.resource_list.block_array_single_element

v2:
- Add AoA support (Timothy)
- Apply it too for GetUniformLocation(), GetUniformName() and others
  because ARB_program_interface_query says that they are equivalent
  to GetProgramResourceLocation() and GetProgramResourceName() (Tapani)

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
src/mesa/main/shader_query.cpp