summaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2016-06-21 16:16:17 -0400
committerIlia Mirkin <[email protected]>2016-06-21 21:58:34 -0400
commit36ed1b695e5a0ae5714b79cae3a089b5e7e8bd29 (patch)
tree7131e5df020ca78ff1bf1d51eb3167a13df3187a /src/compiler
parent1f4bca798dda155ad0615ba81d8373c771d1ec94 (diff)
glsl: only match gl_FragData and not gl_SecondaryFragDataEXT
There's special logic around finding gl_FragData. It latches onto any array with FRAG_RESULT_DATA0. However gl_SecondaryFragDataEXT[], added by GL_EXT_blend_func_extended, fits those parameters as well. The real frag data array should have index 0 though, so we can use that to distinguish them. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96617 Signed-off-by: Ilia Mirkin <[email protected]> Cc: "11.1 11.2 12.0" <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/glsl/opt_dead_builtin_varyings.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/compiler/glsl/opt_dead_builtin_varyings.cpp b/src/compiler/glsl/opt_dead_builtin_varyings.cpp
index 37bcbccf0c5..2e40b78d20b 100644
--- a/src/compiler/glsl/opt_dead_builtin_varyings.cpp
+++ b/src/compiler/glsl/opt_dead_builtin_varyings.cpp
@@ -88,7 +88,9 @@ public:
if (!var || var->data.mode != this->mode || !var->type->is_array())
return visit_continue;
- if (this->find_frag_outputs && var->data.location == FRAG_RESULT_DATA0) {
+ /* Only match gl_FragData[], not gl_SecondaryFragDataEXT[] */
+ if (this->find_frag_outputs && var->data.location == FRAG_RESULT_DATA0 &&
+ var->data.index == 0) {
this->fragdata_array = var;
ir_constant *index = ir->array_index->as_constant();
@@ -143,7 +145,8 @@ public:
if (var->data.mode != this->mode || !var->type->is_array())
return visit_continue;
- if (this->find_frag_outputs && var->data.location == FRAG_RESULT_DATA0) {
+ if (this->find_frag_outputs && var->data.location == FRAG_RESULT_DATA0 &&
+ var->data.index == 0) {
/* This is a whole array dereference. */
this->fragdata_usage |= (1 << var->type->array_size()) - 1;
this->lower_fragdata_array = false;