summaryrefslogtreecommitdiffstats
path: root/src/glsl/opt_constant_propagation.cpp
diff options
context:
space:
mode:
authorJordan Justen <[email protected]>2015-10-10 11:30:33 -0700
committerJordan Justen <[email protected]>2015-12-09 23:50:38 -0800
commitfc21a7c26ea7b49031e4f33dcac5e2a297d2a6f3 (patch)
tree8621a945cf4b417e337bf0bc093dfb994c1b8055 /src/glsl/opt_constant_propagation.cpp
parentf821a3ec4f8dda55722f326f26855c2b24ca186c (diff)
glsl: Disable several optimizations on shared variables
Shared variables can be accessed by other threads within the same local workgroup. This prevents us from performing certain optimizations with shared variables. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]>
Diffstat (limited to 'src/glsl/opt_constant_propagation.cpp')
-rw-r--r--src/glsl/opt_constant_propagation.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/glsl/opt_constant_propagation.cpp b/src/glsl/opt_constant_propagation.cpp
index 184aaa1c297..fb24a4fad04 100644
--- a/src/glsl/opt_constant_propagation.cpp
+++ b/src/glsl/opt_constant_propagation.cpp
@@ -500,7 +500,8 @@ ir_constant_propagation_visitor::add_constant(ir_assignment *ir)
* the variable value isn't modified between this assignment and the next
* instruction where its value is read.
*/
- if (deref->var->data.mode == ir_var_shader_storage)
+ if (deref->var->data.mode == ir_var_shader_storage ||
+ deref->var->data.mode == ir_var_shader_shared)
return;
entry = new(this->mem_ctx) acp_entry(deref->var, ir->write_mask, constant);