From: Timothy Arceri Date: Sat, 30 Jul 2016 06:33:26 +0000 (+1000) Subject: glsl: add name param to validate_flags() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d3dc1b8b5ef61f0e7a11f7d70224e7cd42b37374;p=mesa.git glsl: add name param to validate_flags() Reviewed-by: Kenneth Graunke --- diff --git a/src/compiler/glsl/ast.h b/src/compiler/glsl/ast.h index aa8c4228511..157895d0fbd 100644 --- a/src/compiler/glsl/ast.h +++ b/src/compiler/glsl/ast.h @@ -755,8 +755,8 @@ struct ast_type_qualifier { bool validate_flags(YYLTYPE *loc, _mesa_glsl_parse_state *state, - const char *message, - const ast_type_qualifier &allowed_flags); + const ast_type_qualifier &allowed_flags, + const char *message, const char *name); ast_subroutine_list *subroutine_list; }; diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp index 0b549790339..683c1440178 100644 --- a/src/compiler/glsl/ast_to_hir.cpp +++ b/src/compiler/glsl/ast_to_hir.cpp @@ -4517,10 +4517,9 @@ ast_declarator_list::hir(exec_list *instructions, allowed_atomic_qual_mask.flags.q.explicit_offset = 1; allowed_atomic_qual_mask.flags.q.uniform = 1; - type->qualifier.validate_flags(&loc, state, - "invalid layout qualifier for " - "atomic_uint", - allowed_atomic_qual_mask); + type->qualifier.validate_flags(&loc, state, allowed_atomic_qual_mask, + "invalid layout qualifier for", + "atomic_uint"); } if (this->declarations.is_empty()) { diff --git a/src/compiler/glsl/ast_type.cpp b/src/compiler/glsl/ast_type.cpp index 1f8fb9ccc62..ef573e70598 100644 --- a/src/compiler/glsl/ast_type.cpp +++ b/src/compiler/glsl/ast_type.cpp @@ -600,8 +600,8 @@ ast_type_qualifier::merge_in_qualifier(YYLTYPE *loc, bool ast_type_qualifier::validate_flags(YYLTYPE *loc, _mesa_glsl_parse_state *state, - const char *message, - const ast_type_qualifier &allowed_flags) + const ast_type_qualifier &allowed_flags, + const char *message, const char *name) { ast_type_qualifier bad; bad.flags.i = this->flags.i & ~allowed_flags.flags.i; @@ -609,11 +609,11 @@ ast_type_qualifier::validate_flags(YYLTYPE *loc, return true; _mesa_glsl_error(loc, state, - "%s:" + "%s '%s':" "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s" "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s" "%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n", - message, + message, name, bad.flags.q.invariant ? " invariant" : "", bad.flags.q.precise ? " precise" : "", bad.flags.q.constant ? " constant" : "",