[Mesa-dev] [PATCH 00/11] TGSI support for input and output array declarations
maraeo at gmail.com
Sun May 24 04:19:19 PDT 2015
The reason I add this is that TGSI doesn't allow indirect indexing of inputs and outputs. Consider this:
MOV OUT[ADDR-1000], IMM
There is no way to know where the output array starts here. It could be for example OUT=GENERIC4 or anything else. The problem is some outputs are physically stored in a different memory domain than others. Per-patch (tessellation) outputs are one such example. Does the MOV instruction write a per-vertex or per-patch output? There is no way to know.
The problem can be avoided by using carefully-generated unoptimized TGSI where the relative index is the same as the base of the array, which is OUT here:
UADD TEMP.x, TEMP.x, -1006
UARL ADDR, TEMP.x
MOV OUT[ADDR+6], IMM
This hack helps for this case, but the drivers which do move outputs to temps are still unable to allocate registers efficiently, because there is no way to know the actual array size.
This patch series adds proper TGSI support for IN/OUT arrays. It works in the same way as temp arrays and it's a requirement for tessellation.
More information about the mesa-dev