summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTapani Pälli <[email protected]>2015-06-29 14:19:00 +0300
committerTapani Pälli <[email protected]>2015-07-01 14:40:34 +0300
commitccaf37f4496eb836866c9daacf21f1f5ac8c6d66 (patch)
treeb45a7b72e613ecf20e7fec967ed6d59cd8c72d79 /src
parent19ea623586aacc995b3f4a1a3ea321ead12dc43c (diff)
glsl: build stageref mask using IR, not symbol table
Instead of using symbol table, build mask by inspecting IR. This change is required by further patches to move resource list creation to happen later when symbol table does not exist anymore. Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Martin Peres <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/glsl/linker.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index 74c2f2d4c92..d9527d4ba2b 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -2624,9 +2624,17 @@ build_stageref(struct gl_shader_program *shProg, const char *name)
struct gl_shader *sh = shProg->_LinkedShaders[i];
if (!sh)
continue;
- ir_variable *var = sh->symbols->get_variable(name);
- if (var)
- stages |= (1 << i);
+
+ /* Shader symbol table may contain variables that have
+ * been optimized away. Search IR for the variable instead.
+ */
+ 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;
+ }
+ }
}
return stages;
}