glsl: Don't do tree grafting on buffer variables
authorIago Toral Quiroga <itoral@igalia.com>
Mon, 6 Apr 2015 07:37:58 +0000 (09:37 +0200)
committerSamuel Iglesias Gonsalvez <siglesias@igalia.com>
Tue, 14 Jul 2015 05:04:04 +0000 (07:04 +0200)
Otherwise we can lose writes into the buffers backing the variables.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
src/glsl/opt_tree_grafting.cpp

index d47613c2190cddc722b2c2d72649414c1cf42fd7..7f2ee6cee341ddaaa6ddf1eacd2639cfaa8de36b 100644 (file)
@@ -359,10 +359,11 @@ tree_grafting_basic_block(ir_instruction *bb_first,
       if (!lhs_var)
         continue;
 
-      if (lhs_var->data.mode == ir_var_function_out ||
-         lhs_var->data.mode == ir_var_function_inout ||
-          lhs_var->data.mode == ir_var_shader_out)
-        continue;
+   if (lhs_var->data.mode == ir_var_function_out ||
+       lhs_var->data.mode == ir_var_function_inout ||
+       lhs_var->data.mode == ir_var_shader_out ||
+       lhs_var->data.mode == ir_var_shader_storage)
+      continue;
 
       ir_variable_refcount_entry *entry = info->refs->get_variable_entry(lhs_var);