glsl: Don't do copy propagation on buffer variables
authorIago Toral Quiroga <itoral@igalia.com>
Fri, 24 Apr 2015 09:17:15 +0000 (11:17 +0200)
committerSamuel Iglesias Gonsalvez <siglesias@igalia.com>
Tue, 14 Jul 2015 05:04:04 +0000 (07:04 +0200)
Since the backing storage for these is shared we cannot ensure that
the value won't change by writes from other threads. Normally SSBO
accesses are not guaranteed to be syncronized with other threads,
except when memoryBarrier is used. So, we might be able to optimize
some SSBO accesses, but for now we always take the safe path and emit
the SSBO access.

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

index 806027b280ea9d39e80f8b681a0e0bcf2d06460a..f20699563fd0e60854bcad89f77f5e04c086b0ea 100644 (file)
@@ -330,7 +330,7 @@ ir_copy_propagation_visitor::add_copy(ir_assignment *ir)
          */
         ir->condition = new(ralloc_parent(ir)) ir_constant(false);
         this->progress = true;
-      } else {
+      } else if (lhs_var->data.mode != ir_var_shader_storage) {
         entry = new(this->acp) acp_entry(lhs_var, rhs_var);
         this->acp->push_tail(entry);
       }