[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 20:43:28 UTC 2016


On Thu, Sep 15, 2016 at 4:40 PM, Kenneth Graunke <kenneth at whitecape.org> wrote:
> 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);
>

Sounds good to me. Presumably also throw geometry shaders into that?

"""
    All geometry shader input unsized array declarations will be sized by an
    earlier input primitive layout qualifier, when present, as per the
    following table.
"""

Or are those var's sized by the time this code is hit? With that
worked out, this is

Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>


More information about the mesa-dev mailing list