[Mesa-dev] [PATCH] tgsi/nouveau: Add support for tesselation ctrl and tesselation eval

Ilia Mirkin imirkin at alum.mit.edu
Thu Aug 13 14:43:40 PDT 2015


[mesa-dev readded, please don't drop CC's]

I found it by feeding the shader to nouveau_compiler with
NV50_PROG_DEBUG=1 set, which dumps the input tgsi. Those two should
match up.

On Thu, Aug 13, 2015 at 5:39 PM, Marcos Paulo de souza
<marcos.souza.org at gmail.com> wrote:
> Hi Ilia,
>
> So, how can I test it? Do I need to especify some patameter to verify this
> type of problem?
>
> Thanks for the quick revision!
>
>
> Em 13-08-2015 16:03, Ilia Mirkin escreveu:
>>
>> Hi Macros,
>>
>> Looks like it's not parsed in exactly right. It will parse something like
>>
>> TESS_EVAL
>> PROPERTY TES_PRIM_MODE 7
>> PROPERTY TES_SPACING 2
>> PROPERTY TES_VERTEX_ORDER_CW 0
>> PROPERTY TES_POINT_MODE 0
>> DCL IN[][0], GENERIC[0]
>> DCL IN[][1], GENERIC[1]
>>
>> as
>>
>> TESS_EVAL
>> PROPERTY TES_PRIM_MODE 7
>> PROPERTY TES_SPACING 2
>> PROPERTY TES_VERTEX_ORDER_CW 0
>> PROPERTY TES_POINT_MODE 0
>> DCL IN[][0][0], GENERIC[0]
>> DCL IN[][0][1], GENERIC[1]
>>
>> Perhaps the same issue happens for geometry shaders, but that doesn't
>> make it right :) You might have to look at the printing logic to get a
>> better understanding of what's going wrong.
>>
>> Also you should send patches to nouveau separately from patches to the
>> rest of the infra. Ideally this would have been 2 patches, e.g.
>>
>> tgsi: set implicit array size for tess stages
>> nouveau: recognize tess stages in nouveau_compiler
>>
>> or something like that.
>>
>> On Wed, Aug 12, 2015 at 9:25 PM, Marcos Paulo de Souza
>> <marcos.souza.org at gmail.com> wrote:
>>>
>>> From: Marcos Paulo de Souza <marcos.souza.org at gmail.com>
>>>
>>> Signed-off-by: Marcos Paulo de Souza <marcos.souza.org>
>>> Suggested-by: Ilia Mirkin <imirkin at alum.mit.edu>
>>> ---
>>>   src/gallium/auxiliary/tgsi/tgsi_text.c         | 6 +++++-
>>>   src/gallium/drivers/nouveau/nouveau_compiler.c | 4 ++++
>>>   2 files changed, 9 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/src/gallium/auxiliary/tgsi/tgsi_text.c
>>> b/src/gallium/auxiliary/tgsi/tgsi_text.c
>>> index a6675c5..8647e4e 100644
>>> --- a/src/gallium/auxiliary/tgsi/tgsi_text.c
>>> +++ b/src/gallium/auxiliary/tgsi/tgsi_text.c
>>> @@ -259,7 +259,7 @@ struct translate_ctx
>>>      struct tgsi_token *tokens_end;
>>>      struct tgsi_header *header;
>>>      unsigned processor : 4;
>>> -   int implied_array_size : 5;
>>> +   int implied_array_size : 6;
>>>      unsigned num_immediates;
>>>   };
>>>
>>> @@ -1623,6 +1623,10 @@ static boolean translate( struct translate_ctx
>>> *ctx )
>>>      if (!parse_header( ctx ))
>>>         return FALSE;
>>>
>>> +   if (ctx->processor == TGSI_PROCESSOR_TESS_CTRL ||
>>> +       ctx->processor == TGSI_PROCESSOR_TESS_EVAL)
>>> +       ctx->implied_array_size = 32 ;
>>> +
>>>      while (*ctx->cur != '\0') {
>>>         uint label_val = 0;
>>>         if (!eat_white( &ctx->cur )) {
>>> diff --git a/src/gallium/drivers/nouveau/nouveau_compiler.c
>>> b/src/gallium/drivers/nouveau/nouveau_compiler.c
>>> index 8660498..495450b 100644
>>> --- a/src/gallium/drivers/nouveau/nouveau_compiler.c
>>> +++ b/src/gallium/drivers/nouveau/nouveau_compiler.c
>>> @@ -190,6 +190,10 @@ main(int argc, char *argv[])
>>>         type = PIPE_SHADER_GEOMETRY;
>>>      else if (!strncmp(text, "COMP", 4))
>>>         type = PIPE_SHADER_COMPUTE;
>>> +   else if (!strncmp(text, "TESS_CTRL", 9))
>>> +      type = PIPE_SHADER_TESS_CTRL;
>>> +   else if (!strncmp(text, "TESS_EVAL", 9))
>>> +      type = PIPE_SHADER_TESS_EVAL;
>>>      else {
>>>         _debug_printf("Unrecognized TGSI header\n");
>>>         return 1;
>>> --
>>> 2.4.3
>>>
>>> _______________________________________________
>>> mesa-dev mailing list
>>> mesa-dev at lists.freedesktop.org
>>> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
>


More information about the mesa-dev mailing list