mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 05:18:08 +02:00
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.
(cherry picked from commit 45e8e6c6b1)
This commit is contained in:
parent
b481b8059d
commit
a246791c20
1 changed files with 8 additions and 9 deletions
|
|
@ -2004,7 +2004,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
|
||||
|
|
@ -2013,16 +2013,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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue