[Mesa-dev] [PATCH 2/3] glsl: Skip "unsized arrays aren't allowed" check for TCS/TES vars.

Ilia Mirkin imirkin at alum.mit.edu
Thu Sep 15 19:35:27 UTC 2016


On Thu, Sep 15, 2016 at 5:10 AM, Kenneth Graunke <kenneth at whitecape.org> wrote:
> Fixes ESEXT-CTS.draw_elements_base_vertex_tests.AEP_shader_stages and
> ESEXT-CTS.texture_cube_map_array.texture_size_tesselation_con_sh.
>
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> ---
>  src/compiler/glsl/ast_to_hir.cpp | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
> index 0a23195..90cc924 100644
> --- a/src/compiler/glsl/ast_to_hir.cpp
> +++ b/src/compiler/glsl/ast_to_hir.cpp
> @@ -5127,7 +5127,14 @@ ast_declarator_list::hir(exec_list *instructions,
>           const glsl_type *const t = (earlier == NULL)
>              ? var->type : earlier->type;
>
> -         if (t->is_unsized_array())
> +         /* GL_OES_tessellation_shader allows omitting the array size
> +          * for TCS inputs/outputs and TES inputs.  Ignore this check.
> +          */
> +         bool unsized_ok = state->stage == MESA_SHADER_TESS_CTRL ||

Are you sure that only inputs/outputs can make it in here? I couldn't
come to that conclusion from a quick scan of the code...

> +             (state->stage == MESA_SHADER_TESS_EVAL &&
> +              var->data.mode == ir_var_shader_in);
> +
> +         if (t->is_unsized_array() && !unsized_ok)
>              /* Section 10.17 of the GLSL ES 1.00 specification states that
>               * unsized array declarations have been removed from the language.
>               * Arrays that are sized using an initializer are still explicitly
> --
> 2.9.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list