summaryrefslogtreecommitdiffstats
path: root/src/glsl/ast_to_hir.cpp
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2012-04-23 16:10:12 -0700
committerEric Anholt <[email protected]>2012-05-04 14:00:32 -0700
commitb2ee5a08bae6cdbbdafc1f1d9d6f3afbad2f7944 (patch)
tree3f9b7635817e8c9bf7a755b3cfc0788f7660b779 /src/glsl/ast_to_hir.cpp
parentfcd57280ae687d6b7c11cb8ac8fb8cc4f01a646d (diff)
glsl: Don't consider unused FS out variables as being statically assigned.
I only considered var->assigned for FragColor and FragData, but ignored when it was false for out vars. Fixes piglit write-gl_FragColor-and-not-user-output.frag Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49068
Diffstat (limited to 'src/glsl/ast_to_hir.cpp')
-rw-r--r--src/glsl/ast_to_hir.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index e24914b832a..86bb8741bcc 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -4039,13 +4039,13 @@ detect_conflicting_assignments(struct _mesa_glsl_parse_state *state,
foreach_list(node, instructions) {
ir_variable *var = ((ir_instruction *)node)->as_variable();
- if (!var)
+ if (!var || !var->assigned)
continue;
if (strcmp(var->name, "gl_FragColor") == 0)
- gl_FragColor_assigned = var->assigned;
+ gl_FragColor_assigned = true;
else if (strcmp(var->name, "gl_FragData") == 0)
- gl_FragData_assigned = var->assigned;
+ gl_FragData_assigned = true;
else if (strncmp(var->name, "gl_", 3) != 0) {
if (state->target == fragment_shader &&
(var->mode == ir_var_out || var->mode == ir_var_inout)) {