[Mesa-dev] [PATCH 1/4] glsl: Rename ubo_qualifiers_valid to ubo_qualifiers_allowed.

Matt Turner mattst88 at gmail.com
Thu Aug 15 11:27:13 PDT 2013


The variable means that UBO qualifiers are allowed in a particular
context (e.g., not allowed in a struct field declaration), rather than a
particular set of UBO qualifiers are valid.
---
 src/glsl/ast.h                  | 2 +-
 src/glsl/ast_to_hir.cpp         | 6 +++---
 src/glsl/glsl_parser.yy         | 2 +-
 src/glsl/glsl_parser_extras.cpp | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/glsl/ast.h b/src/glsl/ast.h
index 9b194db..b0446b5 100644
--- a/src/glsl/ast.h
+++ b/src/glsl/ast.h
@@ -640,7 +640,7 @@ public:
     * Flag indicating that these declarators are in a uniform block,
     * allowing UBO type qualifiers.
     */
-   bool ubo_qualifiers_valid;
+   bool ubo_qualifiers_allowed;
 };
 
 
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index 04b16c8..9bc713d 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -1929,7 +1929,7 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual,
 				 ir_variable *var,
 				 struct _mesa_glsl_parse_state *state,
 				 YYLTYPE *loc,
-				 bool ubo_qualifiers_valid,
+				 bool ubo_qualifiers_allowed,
                                  bool is_parameter)
 {
    STATIC_ASSERT(sizeof(qual->flags.q) <= sizeof(qual->flags.i));
@@ -2275,7 +2275,7 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual,
    }
 
    if (qual->flags.q.row_major || qual->flags.q.column_major) {
-      if (!ubo_qualifiers_valid) {
+      if (!ubo_qualifiers_allowed) {
 	 _mesa_glsl_error(loc, state,
 			  "uniform block layout qualifiers row_major and "
 			  "column_major can only be applied to uniform block "
@@ -2830,7 +2830,7 @@ ast_declarator_list::hir(exec_list *instructions,
       }
 
       apply_type_qualifier_to_variable(& this->type->qualifier, var, state,
-				       & loc, this->ubo_qualifiers_valid, false);
+				       & loc, this->ubo_qualifiers_allowed, false);
 
       if (this->type->qualifier.flags.q.invariant) {
 	 if ((state->target == vertex_shader) &&
diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy
index e3a57ea..0ed3453 100644
--- a/src/glsl/glsl_parser.yy
+++ b/src/glsl/glsl_parser.yy
@@ -2295,7 +2295,7 @@ member_declaration:
 
       $$ = new(ctx) ast_declarator_list(type);
       $$->set_location(yylloc);
-      $$->ubo_qualifiers_valid = true;
+      $$->ubo_qualifiers_allowed = true;
 
       $$->declarations.push_degenerate_list_at_head(& $2->link);
    }
diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp
index 88f0483..98fd510 100644
--- a/src/glsl/glsl_parser_extras.cpp
+++ b/src/glsl/glsl_parser_extras.cpp
@@ -1170,7 +1170,7 @@ ast_declarator_list::ast_declarator_list(ast_fully_specified_type *type)
 {
    this->type = type;
    this->invariant = false;
-   this->ubo_qualifiers_valid = false;
+   this->ubo_qualifiers_allowed = false;
 }
 
 void
-- 
1.8.3.2



More information about the mesa-dev mailing list