glsl: Add varyings to "zero-init of uninitialized vars" workaround
authorDanylo Piliaiev <danylo.piliaiev@globallogic.com>
Thu, 21 Nov 2019 13:04:37 +0000 (15:04 +0200)
committerDanylo Piliaiev <danylo.piliaiev@gmail.com>
Fri, 22 Nov 2019 15:25:56 +0000 (15:25 +0000)
Varyings are similar to already handled cases. And "glsl_zero_init"
name of the workaround already looks like it should include varyings.

The issue was observed in GiMark subtest from GpuTest.

Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/compiler/glsl/ast_to_hir.cpp

index 214412bc30a73954d2f20b40f40b9a9010510b81..7b7f6aff62aced4a3045d0c6b444f959fed8fee3 100644 (file)
@@ -5195,7 +5195,8 @@ ast_declarator_list::hir(exec_list *instructions,
       apply_layout_qualifier_to_variable(&this->type->qualifier, var, state,
                                          &loc);
 
-      if ((var->data.mode == ir_var_auto || var->data.mode == ir_var_temporary)
+      if ((var->data.mode == ir_var_auto || var->data.mode == ir_var_temporary
+           || var->data.mode == ir_var_shader_out)
           && (var->type->is_numeric() || var->type->is_boolean())
           && state->zero_init) {
          const ir_constant_data data = { { 0 } };