[Mesa-dev] [PATCH 04/20] glsl: set stage flag for structs and arrays in resource list
Timothy Arceri
t_arceri at yahoo.com.au
Wed Jul 29 06:56:46 PDT 2015
This fixes the remaining failing tests in:
ES31-CTS.program_interface_query.uniform-types
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias at igalia.com>
---
src/glsl/linker.cpp | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index a781211..a16dab4 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;
+ }
+ }
}
}
}
--
2.4.3
More information about the mesa-dev
mailing list