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

Kenneth Graunke kenneth at whitecape.org
Thu Sep 15 20:40:06 UTC 2016


On Thursday, September 15, 2016 3:35:27 PM PDT Ilia Mirkin wrote:
> 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...

Whoops.  No, other things can get here too.  How about:

         const bool unsized_ok =
            (stage->state == MESA_SHADER_TESS_CTRL &&
             (var->data.mode == ir_var_shader_in ||
              var->data.mode == ir_var_shader_out)) ||
            (stage->state == MESA_SHADER_TESS_EVAL &&
             var->data.mode == ir_var_shader_in);

> > +             (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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160915/bb18017d/attachment.sig>


More information about the mesa-dev mailing list