summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/opt_dead_builtin_varyings.cpp
diff options
context:
space:
mode:
authorFrancisco Jerez <currojerez@riseup.net>2016-07-19 20:23:17 -0700
committerFrancisco Jerez <currojerez@riseup.net>2016-08-24 13:28:31 -0700
commit5e1d34394e80198da774ca87133da34506a89c29 (patch)
tree053d36750c24ed07d2981f1129543bcfc2667b51 /src/compiler/glsl/opt_dead_builtin_varyings.cpp
parent6b33eab959433fdcb4f3fce7c571a83e8050cdf0 (diff)
downloadexternal_mesa3d-5e1d34394e80198da774ca87133da34506a89c29.zip
external_mesa3d-5e1d34394e80198da774ca87133da34506a89c29.tar.gz
external_mesa3d-5e1d34394e80198da774ca87133da34506a89c29.tar.bz2
glsl: Don't attempt to do dead varying elimination on gl_LastFragData arrays.
Apparently this pass can only handle elimination of a single built-in fragment output array, so the presence of gl_LastFragData (which it wouldn't split correctly anyway) could prevent it from splitting the actual gl_FragData array. Just match gl_FragData by name since it's the only built-in it can handle. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/compiler/glsl/opt_dead_builtin_varyings.cpp')
-rw-r--r--src/compiler/glsl/opt_dead_builtin_varyings.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/compiler/glsl/opt_dead_builtin_varyings.cpp b/src/compiler/glsl/opt_dead_builtin_varyings.cpp
index 900a096..4526f2b 100644
--- a/src/compiler/glsl/opt_dead_builtin_varyings.cpp
+++ b/src/compiler/glsl/opt_dead_builtin_varyings.cpp
@@ -89,9 +89,10 @@ public:
!is_gl_identifier(var->name))
return visit_continue;
- /* Only match gl_FragData[], not gl_SecondaryFragDataEXT[] */
- if (this->find_frag_outputs && var->data.location == FRAG_RESULT_DATA0 &&
- var->data.index == 0) {
+ /* Only match gl_FragData[], not gl_SecondaryFragDataEXT[] or
+ * gl_LastFragData[].
+ */
+ if (this->find_frag_outputs && strcmp(var->name, "gl_FragData") == 0) {
this->fragdata_array = var;
ir_constant *index = ir->array_index->as_constant();