}
if (var->type->contains_atomic()) {
- if (var->data.mode == ir_var_uniform) {
+ if (var->data.mode == ir_var_uniform || var->data.mode == ir_var_shader_storage) {
if (var->data.explicit_binding) {
unsigned *offset =
&state->atomic_counter_offsets[var->data.binding];
}
} else if (var->data.mode != ir_var_function_in) {
_mesa_glsl_error(loc, state, "atomic counters may only be declared as "
- "function parameters or uniform-qualified "
- "global variables");
+ "function parameters, uniform-qualified or "
+ "buffer-qualified global variables");
}
}