[Mesa-dev] [PATCH 2/4] gallium: Add PIPE_SHADER_CAP_INDIRECT_TEMP_ARRAY_ADDR

Marek Olšák maraeo at gmail.com
Sun Nov 25 14:31:05 PST 2012


On Thu, Nov 8, 2012 at 7:08 PM, Christoph Bumiller
<e0425955 at student.tuwien.ac.at> wrote:
>
> DCL TEMP[0..3] = "array" without indirect access (registers)
> DCL TEMP[4..12] = indirectly accessed array
> DCL TEMP[12..20] = another indirectly accessed array
> DCL IMM[0] { -2, 0, 0, 0 }
>
> fill with data:
> MOV TEMP[4], IN[1]
> MOV TEMP[5], IN[2]
> etc.
>
> indirect move with address (IN[0].x - 2) from array TEMP[4..12] to output:
> UADD TEMP[0].x, IN[0].x, IMM[0].x <- added here explicitly instead of
> using (4 - IMM[0].x == 2) in the MOV below
> UARL ADDR[0].x, TEMP[0].x
> MOV OUT[1], TEMP[ADDR[0].x + 4] <- must be 4 here to identify the
> array/range (iff there is indirect addressing)

I don't like this. It looks hackish. I think it would be better to
have the array clearly specified in the declaration and in the
instruction. For example like this:

DCL TEMP[0][0..3] = "array" without indirect access (registers)
DCL TEMP[1][0..7] = indirectly accessed array
DCL TEMP[2][0..7] = another indirectly accessed array
DCL TEMP[3] = ill-formed declaration

And in the instruction:

MOV OUT[1], TEMP[1][ADDR[0].x]

That said, I don't know how the temporary array file is implemented in
TGSI. I would have to see some TGSI shader code first. If it's
implemented just like my example shows, then I'm all for it and we can
later deprecate the TEMPORARY file once all drivers support
TEMPORARY_ARRAY.

Marek


More information about the mesa-dev mailing list