summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/glsl/ast.h9
-rw-r--r--src/glsl/ast_to_hir.cpp4
-rw-r--r--src/glsl/glsl_parser.yy2
3 files changed, 8 insertions, 7 deletions
diff --git a/src/glsl/ast.h b/src/glsl/ast.h
index 816d5fccbbc..1208704ff6d 100644
--- a/src/glsl/ast.h
+++ b/src/glsl/ast.h
@@ -534,7 +534,7 @@ public:
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_precision_statement(that->is_precision_statement)
+ default_precision(that->default_precision)
{
/* empty */
}
@@ -543,7 +543,7 @@ public:
ast_type_specifier(const char *name)
: type_name(name), structure(NULL),
is_array(false), array_size(NULL), precision(ast_precision_none),
- is_precision_statement(false)
+ default_precision(ast_precision_none)
{
/* empty */
}
@@ -552,7 +552,7 @@ public:
ast_type_specifier(ast_struct_specifier *s)
: type_name(s->name), structure(s),
is_array(false), array_size(NULL), precision(ast_precision_none),
- is_precision_statement(false)
+ default_precision(ast_precision_none)
{
/* empty */
}
@@ -573,7 +573,8 @@ public:
unsigned precision:2;
- bool is_precision_statement;
+ /** For precision statements, this is the given precision; otherwise none. */
+ unsigned default_precision:2;
};
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index 28ccf728870..c1a2af30aea 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -3958,7 +3958,7 @@ ir_rvalue *
ast_type_specifier::hir(exec_list *instructions,
struct _mesa_glsl_parse_state *state)
{
- if (!this->is_precision_statement && this->structure == NULL)
+ if (this->default_precision == ast_precision_none && this->structure == NULL)
return NULL;
YYLTYPE loc = this->get_location();
@@ -3984,7 +3984,7 @@ ast_type_specifier::hir(exec_list *instructions,
* field can be either int or float [...]. Any other types or
* qualifiers will result in an error.
*/
- if (this->is_precision_statement) {
+ if (this->default_precision != ast_precision_none) {
assert(this->precision != ast_precision_none);
assert(this->structure == NULL); /* The check for structures was
* performed above. */
diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy
index ff57c29741f..1a13f485503 100644
--- a/src/glsl/glsl_parser.yy
+++ b/src/glsl/glsl_parser.yy
@@ -793,7 +793,7 @@ declaration:
| PRECISION precision_qualifier type_specifier_no_prec ';'
{
$3->precision = $2;
- $3->is_precision_statement = true;
+ $3->default_precision = $2;
$$ = $3;
}
| interface_block