summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/glsl/opt_dead_code.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/glsl/opt_dead_code.cpp b/src/glsl/opt_dead_code.cpp
index 7b4730a39bb..04e4d5673d2 100644
--- a/src/glsl/opt_dead_code.cpp
+++ b/src/glsl/opt_dead_code.cpp
@@ -77,11 +77,13 @@ do_dead_code(exec_list *instructions, bool uniform_locations_assigned)
if (entry->assign) {
/* Remove a single dead assignment to the variable we found.
- * Don't do so if it's a shader or function output, though.
+ * Don't do so if it's a shader or function output or a shader
+ * storage variable though.
*/
if (entry->var->data.mode != ir_var_function_out &&
entry->var->data.mode != ir_var_function_inout &&
- entry->var->data.mode != ir_var_shader_out) {
+ entry->var->data.mode != ir_var_shader_out &&
+ entry->var->data.mode != ir_var_shader_storage) {
entry->assign->remove();
progress = true;
@@ -99,7 +101,8 @@ do_dead_code(exec_list *instructions, bool uniform_locations_assigned)
* stage. Also, once uniform locations have been assigned, the
* declaration cannot be deleted.
*/
- if (entry->var->data.mode == ir_var_uniform) {
+ if (entry->var->data.mode == ir_var_uniform ||
+ entry->var->data.mode == ir_var_shader_storage) {
if (uniform_locations_assigned || entry->var->constant_value)
continue;