Module: Mesa Branch: master Commit: 750393ff7d6162372f368f5ed726b23f4cae49a0 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=750393ff7d6162372f368f5ed726b23f4cae49a0
Author: Iago Toral Quiroga <[email protected]> Date: Fri Nov 27 12:46:20 2015 +0100 glsl/dead_builin_varyings: Fix gl_FragData array lowering The current implementation looks for array dereferences on gl_FragData and immediately proceeds to lower them, however this is not enough because we can have array access on vector variables too, like in this code: out vec4 color; void main() { int i; for (i = 0; i < 4; i++) color[i] = 1.0; } Fix it by making sure that the actual variable being dereferenced is an array. Fixes a crash in: spec/arb_gpu_shader_fp64/execution/built-in-functions/fs-ldexp-dvec4.shader_test Reviewed-by: Tapani Pälli <[email protected]> --- src/glsl/opt_dead_builtin_varyings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/glsl/opt_dead_builtin_varyings.cpp b/src/glsl/opt_dead_builtin_varyings.cpp index 68b70ee..5387113 100644 --- a/src/glsl/opt_dead_builtin_varyings.cpp +++ b/src/glsl/opt_dead_builtin_varyings.cpp @@ -85,7 +85,7 @@ public: { ir_variable *var = ir->variable_referenced(); - if (!var || var->data.mode != this->mode) + 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) { _______________________________________________ mesa-commit mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/mesa-commit
