glsl: atomic counters can be declared as buffer-qualified variables
authorSamuel Iglesias Gonsalvez <siglesias@igalia.com>
Wed, 23 Sep 2015 07:04:53 +0000 (09:04 +0200)
committerSamuel Iglesias Gonsalvez <siglesias@igalia.com>
Fri, 25 Sep 2015 06:39:22 +0000 (08:39 +0200)
Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
src/glsl/ast_to_hir.cpp

index d6071ef59fc2aa3c5ca6e5469f3ccbb0eae85c9c..97c6350b1f0274fba760a0613977abb2454c6635 100644 (file)
@@ -2789,7 +2789,7 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual,
    }
 
    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];
@@ -2807,8 +2807,8 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual,
          }
       } 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");
       }
    }