summaryrefslogtreecommitdiffstats
path: root/src/glsl/ast_to_hir.cpp
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2013-07-15 15:39:35 -0700
committerKenneth Graunke <[email protected]>2013-07-18 16:57:23 -0700
commit308d4c71466af7ad5cbb99f8b4fddd743f2a2b25 (patch)
tree797ee94145e9492a4507ca550160f0d6a5702762 /src/glsl/ast_to_hir.cpp
parent7855482138480d88e7ca167d2acca9b93fe011b9 (diff)
glsl: Change is_precision_statement to default_precision != none.
Currently, we store precision in ast_type_specifier, rather than ast_type_qualifier. This works because precision is the last qualifier, and immediately adjacent to the type. Default precision statements (such as "precision highp float") are represented as ast_type_specifier objects, with a boolean to indicate that it's a default precision statement rather than an ordinary type. ast_type_specifier::precision will be moving to ast_type_qualifier soon, in order to support arbitrary qualifier ordering. However, we still need to store a "this is a precision statement" flag /and/ the default precision in ast_type_specifier. This patch changes the boolean into a new field, default_precision. If default_precision != ast_precision_none, it's a precision statement with the specified precision. Otherwise, it's an ordinary type. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/glsl/ast_to_hir.cpp')
-rw-r--r--src/glsl/ast_to_hir.cpp4
1 files changed, 2 insertions, 2 deletions
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. */