[Mesa-dev] [PATCH] glsl: simplify validation of illegal layouts on block members

Timothy Arceri t_arceri at yahoo.com.au
Wed Nov 11 21:13:42 PST 2015


From: Timothy Arceri <timothy.arceri at collabora.com>

We already give the location of the qualifier so there is
no need to list all the identifiers in the error message.

Also not calling the binding validation function will make things
much simpler when adding compile time constant support as we
wont need to resolve the binding value.
---
 src/glsl/ast_to_hir.cpp | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index 9d341e8..79bd4e7 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -5896,18 +5896,14 @@ ast_process_structure_or_interface_block(exec_list *instructions,
          const struct ast_type_qualifier *const qual =
             & decl_list->type->qualifier;
 
-         if (qual->flags.q.explicit_binding)
-            validate_binding_qualifier(state, &loc, decl_type, qual);
-
          if (qual->flags.q.std140 ||
              qual->flags.q.std430 ||
              qual->flags.q.packed ||
-             qual->flags.q.shared) {
+             qual->flags.q.shared ||
+             qual->flags.q.explicit_binding) {
             _mesa_glsl_error(&loc, state,
-                             "uniform/shader storage block layout qualifiers "
-                             "std140, std430, packed, and shared can only be "
-                             "applied to uniform/shader storage blocks, not "
-                             "members");
+                             "this layout qualifier can only be applied to "
+                             "uniform/shader storage blocks, not members");
          }
 
          if (qual->flags.q.constant) {
-- 
2.4.3



More information about the mesa-dev mailing list