Mesa (master): glsl: revert "glsl: atomic counters can be declared as buffer-qualified variables"

Iago Toral Quiroga itoral at kemper.freedesktop.org
Mon Sep 28 12:26:59 UTC 2015


Module: Mesa
Branch: master
Commit: e7ae6d9e141489281295352e43facbc1aeb137d9
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e7ae6d9e141489281295352e43facbc1aeb137d9

Author: Iago Toral Quiroga <itoral at igalia.com>
Date:   Mon Sep 28 13:56:28 2015 +0200

glsl: revert "glsl: atomic counters can be declared as buffer-qualified variables"

This reverts commit 586142658e2927a68c.

The specs are not explicit about any restrictions related to the types allowed
on buffer variables, however, the description of opaque types (like atomic
counters) is in conclict with the purpose of buffer variables:

"The opaque types declare variables that are effectively opaque
 handles to other objects. These objects are
 accessed through built-in functions, not through direct reading or
 writing of the declared variable.
 (...)
 Opaque variables cannot be treated as l-values;(...)"

Also, Mesa is already disallowing opaque types in interface blocks anyway, so
that commit was not really achieving anything.

Reviewed-by: Francisco Jerez <currojerez at riseup.net>

---

 src/glsl/ast_to_hir.cpp |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index b8d66dd..5e69bcc 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -2854,7 +2854,7 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual,
    }
 
    if (var->type->contains_atomic()) {
-      if (var->data.mode == ir_var_uniform || var->data.mode == ir_var_shader_storage) {
+      if (var->data.mode == ir_var_uniform) {
          if (var->data.explicit_binding) {
             unsigned *offset =
                &state->atomic_counter_offsets[var->data.binding];
@@ -2872,8 +2872,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, uniform-qualified or "
-                          "buffer-qualified global variables");
+                          "function parameters or uniform-qualified "
+                          "global variables");
       }
    }
 




More information about the mesa-commit mailing list