From 6eec502e84f2b4f6118544e78d2e97928618ba0f Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Mon, 15 Jul 2013 15:58:29 -0700 Subject: glsl: Move precision handling to be part of qualifier handling. This is necessary for the parser to be able to accept precision qualifiers not immediately adjacent to the type, such as "const highp inout float foo". Signed-off-by: Kenneth Graunke Reviewed-by: Matt Turner --- src/glsl/ast.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/glsl/ast.h') diff --git a/src/glsl/ast.h b/src/glsl/ast.h index 1208704ff6d..6aede009c8c 100644 --- a/src/glsl/ast.h +++ b/src/glsl/ast.h @@ -437,6 +437,9 @@ struct ast_type_qualifier { unsigned i; } flags; + /** Precision of the type (highp/medium/lowp). */ + unsigned precision:2; + /** * Location specified via GL_ARB_explicit_attrib_location layout * @@ -533,7 +536,7 @@ public: ast_type_specifier(const ast_type_specifier *that, bool is_array, ast_expression *array_size) : ast_node(), type_name(that->type_name), structure(that->structure), - is_array(is_array), array_size(array_size), precision(that->precision), + is_array(is_array), array_size(array_size), default_precision(that->default_precision) { /* empty */ @@ -542,7 +545,7 @@ public: /** Construct a type specifier from a type name */ ast_type_specifier(const char *name) : type_name(name), structure(NULL), - is_array(false), array_size(NULL), precision(ast_precision_none), + is_array(false), array_size(NULL), default_precision(ast_precision_none) { /* empty */ @@ -551,7 +554,7 @@ public: /** Construct a type specifier from a structure definition */ ast_type_specifier(ast_struct_specifier *s) : type_name(s->name), structure(s), - is_array(false), array_size(NULL), precision(ast_precision_none), + is_array(false), array_size(NULL), default_precision(ast_precision_none) { /* empty */ @@ -571,8 +574,6 @@ public: bool is_array; ast_expression *array_size; - unsigned precision:2; - /** For precision statements, this is the given precision; otherwise none. */ unsigned default_precision:2; }; -- cgit v1.2.3