summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChad Versace <[email protected]>2011-01-17 15:28:39 -0800
committerChad Versace <[email protected]>2011-01-18 14:43:49 -0800
commit45e8e6c6b1b7f3bc00a578fa6809c9bc719c171a (patch)
tree59eb59b398e9d348fd328e8158f3115f05e1214c
parent42dbc2530b5a2263012f3fa0e48517a1b8db1c52 (diff)
glsl: Fix semantic checks on precision qualifiers
The check for Precision qualifiers only apply to floating point and integer types. was incomplete. It rejected only type 'bool' and structures.
-rw-r--r--src/glsl/ast_to_hir.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index e3164d8c617..477efade814 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -2363,7 +2363,7 @@ ast_declarator_list::hir(exec_list *instructions,
}
- /* Precision qualifiers do not apply to bools and structs.
+ /* Precision qualifiers only apply to floating point and integer types.
*
* From section 4.5.2 of the GLSL 1.30 spec:
* "Any floating point or any integer declaration can have the type
@@ -2372,16 +2372,15 @@ ast_declarator_list::hir(exec_list *instructions,
* variables.
*/
if (this->type->specifier->precision != ast_precision_none
- && this->type->specifier->type_specifier == ast_bool) {
+ && !var->type->is_float()
+ && !var->type->is_integer()
+ && !(var->type->is_array()
+ && (var->type->fields.array->is_float()
+ || var->type->fields.array->is_integer()))) {
_mesa_glsl_error(&loc, state,
- "preicion qualifiers do not apply to type bool");
- }
- if (this->type->specifier->precision != ast_precision_none
- && this->type->specifier->structure != NULL) {
-
- _mesa_glsl_error(&loc, state,
- "precision qualifiers do not apply to structures");
+ "precision qualifiers apply only to floating point "
+ "and integer types");
}
/* Process the initializer and add its instructions to a temporary