[Mesa-dev] [PATCH (resend)] r600/sb: Don't require array declarations for TGSI_FILE_SYSTEM_VALUE

Ilia Mirkin imirkin at alum.mit.edu
Fri Feb 2 11:56:21 UTC 2018


On Fri, Feb 2, 2018 at 4:07 AM, Gert Wollny <gw.fossdev at gmail.com> wrote:
> Am Freitag, den 02.02.2018, 09:04 +0100 schrieb Roland Scheidegger:
>>
>>
>> Yes, the _GL spec_ says it is an array.
>> But in gallium it can't be. Therefore I think it's incorrect if we
>> end up with array accesses there (albeit I was too lazy to actually
>> look at the tgsi, but I'm pretty sure it isn't declard as an array).
> the TGSI for the relevant shader in the piglit looks like this:
>
> FRAG
> DCL SV[0], SAMPLEMASK
> DCL OUT[0], COLOR
> DCL CONST[0][0]
> DCL TEMP[0..1], LOCAL
> DCL ADDR[0]
> IMM[0] FLT32 {    1.0000,     0.0000,     0.0000,     0.0000}
> IMM[1] INT32 {1, 0, 0, 0}
>   0: MOV TEMP[0], IMM[0].xyyx
>   1: UARL ADDR[0].x, CONST[0][0].xxxx
>   2: USEQ TEMP[1].x, SV[ADDR[0].x].xxxx, IMM[1].xxxx

OK, this is a big problem. I'm guessing the GLSL code was something like

gl_SampleMaskIn[uniform]

What this got translated into was an indirect access into the *global
implicit array of system values*. We don't want that. glsl_to_tgsi
should just be dropping the indirect access entirely.

Cheers,

  -ilia


More information about the mesa-dev mailing list