summaryrefslogtreecommitdiffstats
path: root/src/glsl/ast.h
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2013-07-15 15:58:29 -0700
committerKenneth Graunke <kenneth@whitecape.org>2013-07-18 16:57:23 -0700
commit6eec502e84f2b4f6118544e78d2e97928618ba0f (patch)
tree4038419dc9b63470ead127b85d0950186660dce5 /src/glsl/ast.h
parent308d4c71466af7ad5cbb99f8b4fddd743f2a2b25 (diff)
downloadexternal_mesa3d-6eec502e84f2b4f6118544e78d2e97928618ba0f.zip
external_mesa3d-6eec502e84f2b4f6118544e78d2e97928618ba0f.tar.gz
external_mesa3d-6eec502e84f2b4f6118544e78d2e97928618ba0f.tar.bz2
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 <kenneth@whitecape.org> Reviewed-by: Matt Turner <mattst88@gmail.com>
Diffstat (limited to 'src/glsl/ast.h')
-rw-r--r--src/glsl/ast.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/glsl/ast.h b/src/glsl/ast.h
index 1208704..6aede00 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;
};