[Mesa-dev] [PATCH 07/11] glsl: error out on empty declarations
Erik Faye-Lund
kusmabite at gmail.com
Mon Jan 19 04:52:45 PST 2015
On Mon, Jan 19, 2015 at 12:32 PM, Eduardo Lima Mitev <elima at igalia.com> wrote:
> From: Iago Toral Quiroga <itoral at igalia.com>
>
> So far we have only been emitting a warning.
>
> Fixes the following 2 dEQP tests:
> dEQP-GLES3.functional.shaders.arrays.invalid.empty_declaration_without_var_name_vertex
> dEQP-GLES3.functional.shaders.arrays.invalid.empty_declaration_without_var_name_fragment
> ---
> src/glsl/ast_to_hir.cpp | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
> index c52e4af..5ed8b0e 100644
> --- a/src/glsl/ast_to_hir.cpp
> +++ b/src/glsl/ast_to_hir.cpp
> @@ -3406,7 +3406,7 @@ ast_declarator_list::hir(exec_list *instructions,
> "lowp"
> };
>
> - _mesa_glsl_warning(&loc, state,
> + _mesa_glsl_error(&loc, state,
> "empty declaration with precision qualifier, "
> "to set the default precision, use "
> "`precision %s %s;'",
> @@ -3414,7 +3414,7 @@ ast_declarator_list::hir(exec_list *instructions,
> type_name);
> }
> } else if (this->type->specifier->structure == NULL) {
> - _mesa_glsl_warning(&loc, state, "empty declaration");
> + _mesa_glsl_error(&loc, state, "empty declaration");
> }
> }
>
OpenGL ES 3.1 specifies this as allowed, as far as I can tell:
Section 4.11:
"Empty declarations are allowed. E.g.
int; // No effect
struct S {int x;}; // Defines a struct S"
OpenGL ES 3.0 seems to not say, which generally should be interpreted
as "allowed". In fact, no such error is listed in section 10 of the
spec, which is the list of errors required to detect.
So I think these dEQP-tests are bogus.
More information about the mesa-dev
mailing list