From 4b756b20c446bbaf0911d1b66c5a405ab3b133ef Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Sun, 27 Apr 2014 16:03:53 +1200 Subject: glsl: add support for `precise` in type_qualifier Signed-off-by: Chris Forbes Reviewed-by: Jordan Justen --- src/glsl/ast_to_hir.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/glsl/ast_to_hir.cpp') 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. -- cgit v1.2.3