summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2015-07-04 15:43:15 +1000
committerTimothy Arceri <[email protected]>2015-07-30 19:33:33 +1000
commit75a96cedf7b0e5613560be0962dec973a4d2f2fe (patch)
tree39b5ce45358e8de52aa6a491bf656368e38c6aea /src
parent1b2b0e42ce47bfd1fcb5513ed2c23b9bb7a5a5b8 (diff)
glsl: set stage flag for structs and arrays in resource list
This fixes the remaining failing tests in: ES31-CTS.program_interface_query.uniform-types Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/glsl/linker.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index a7812116944..a16dab4ddcd 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -3129,9 +3129,19 @@ build_stageref(struct gl_shader_program *shProg, const char *name)
*/
foreach_in_list(ir_instruction, node, sh->ir) {
ir_variable *var = node->as_variable();
- if (var && strcmp(var->name, name) == 0) {
- stages |= (1 << i);
- break;
+ if (var) {
+ unsigned baselen = strlen(var->name);
+ if (strncmp(var->name, name, baselen) == 0) {
+ /* Check for exact name matches but also check for arrays and
+ * structs.
+ */
+ if (name[baselen] == '\0' ||
+ name[baselen] == '[' ||
+ name[baselen] == '.') {
+ stages |= (1 << i);
+ break;
+ }
+ }
}
}
}