[Mesa-dev] [PATCH] glsl: remove restriction on unsized arrays in GLSL ES 3.10

Tapani Pälli tapani.palli at intel.com
Tue Jun 9 00:47:16 PDT 2015


Reviewed-by: Tapani Pälli <tapani.palli at intel.com>


On 06/09/2015 10:03 AM, Timothy Arceri wrote:
> ---
>   src/glsl/ast_to_hir.cpp | 10 +++++++++-
>   1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
> index dfe106b..350f6ed 100644
> --- a/src/glsl/ast_to_hir.cpp
> +++ b/src/glsl/ast_to_hir.cpp
> @@ -3850,7 +3850,15 @@ ast_declarator_list::hir(exec_list *instructions,
>                             decl->identifier);
>         }
>
> -      if (state->es_shader) {
> +      /* GLSL ES 3.10 removes the restriction on unsized arrays.
> +       *
> +       * Section 4.1.9 (Arrays) of the GLSL ES 3.10 spec says:
> +       *
> +       *    "Variables of the same type can be aggregated into arrays by
> +       *     declaring a name followed by brackets ([ ]) enclosing an
> +       *     optional size."
> +       */
> +      if (state->es_shader && state->language_version < 310) {
>            const glsl_type *const t = (earlier == NULL)
>               ? var->type : earlier->type;
>
>


More information about the mesa-dev mailing list