summaryrefslogtreecommitdiffstats
path: root/src/glsl/ast_to_hir.cpp
diff options
context:
space:
mode:
authorChris Forbes <[email protected]>2014-04-27 16:03:53 +1200
committerChris Forbes <[email protected]>2014-06-04 18:56:03 +1200
commit4b756b20c446bbaf0911d1b66c5a405ab3b133ef (patch)
tree67b52b3734b059baf0e2e8fbd603977704781c1b /src/glsl/ast_to_hir.cpp
parent37ab3ddbf8ecc691b784fc2145242369f0b094f6 (diff)
glsl: add support for `precise` in type_qualifier
Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src/glsl/ast_to_hir.cpp')
-rw-r--r--src/glsl/ast_to_hir.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index f230a70a3ed..0b28b4814c4 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -2393,6 +2393,17 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual,
}
}
+ if (qual->flags.q.precise) {
+ if (var->data.used) {
+ _mesa_glsl_error(loc, state,
+ "variable `%s' may not be redeclared "
+ "`precise' after being used",
+ var->name);
+ } else {
+ var->data.precise = 1;
+ }
+ }
+
if (qual->flags.q.constant || qual->flags.q.attribute
|| qual->flags.q.uniform
|| (qual->flags.q.varying && (state->stage == MESA_SHADER_FRAGMENT)))
@@ -3165,6 +3176,7 @@ ast_declarator_list::hir(exec_list *instructions,
assert(this->type != NULL);
assert(!this->invariant);
+ assert(!this->precise);
/* The type specifier may contain a structure definition. Process that
* before any of the variable declarations.