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;
* 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;