[Mesa-dev] Handling component layouts in TGSI

Ilia Mirkin imirkin at alum.mit.edu
Sun Jul 24 22:32:38 UTC 2016


I was working on the component layouts stuff required for
ARB_enhanced_layouts, and ran into an issue with representing this in
TGSI.

Right now when we indirectly index into arrays, we include an ArrayID
to indicate which array it is we're indexing into.

However with component layouts, we might have an array that spans
components 0..2 of positions 0..10, and then another array that spans
component 3 of positions 0..5 and another for component 3 of positions
6..10.

I'm thinking that this will make sense to be represented as

DECL IN[0..10](1).xyz
DECL IN[0..5](2).w
DECL IN[6..10](3).w

And then accessing something like IN[4].xyzw would be fully legit,
however indirect accesses would have to specify the array id, and only
refer to the components of the declared array.

Does this sound reasonable to everyone? Is there a better (read:
simpler) way of handling this?

Cheers,

  -ilia


More information about the mesa-dev mailing list