summaryrefslogtreecommitdiffstats
path: root/src/glsl/opt_constant_variable.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/glsl/opt_constant_variable.cpp')
-rw-r--r--src/glsl/opt_constant_variable.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/glsl/opt_constant_variable.cpp b/src/glsl/opt_constant_variable.cpp
index 7222eb92a7d..7aaaeedf98d 100644
--- a/src/glsl/opt_constant_variable.cpp
+++ b/src/glsl/opt_constant_variable.cpp
@@ -115,6 +115,13 @@ ir_constant_variable_visitor::visit_enter(ir_assignment *ir)
if (!var)
return visit_continue;
+ /* Ignore buffer variables, since the underlying storage is shared
+ * and we can't be sure that this variable won't be written by another
+ * thread.
+ */
+ if (var->data.mode == ir_var_shader_storage)
+ return visit_continue;
+
constval = ir->rhs->constant_expression_value();
if (!constval)
return visit_continue;