* and we can't be sure that this variable won't be written by another
* thread.
*/
- if (var->data.mode == ir_var_shader_storage)
+ if (var->data.mode == ir_var_shader_storage ||
+ var->data.mode == ir_var_shader_shared)
return visit_continue;
constval = ir->rhs->constant_expression_value();