[Mesa-dev] [PATCH 1/2] tgsi: add support for texture offsets to the TGSI IR.
airlied at gmail.com
Tue Aug 30 08:50:27 PDT 2011
> Extending TSGI is a bit of a black art but you seem to have figured it out.
> I'm looking at the swizzle fields in tgsi_texture_offset. Why do
> those exist? I'm guessing it's just for the case that a bunch of
> offsets get tightly packed in a constant slot. 0, 1, -1 would seem to
> be very common offsets so a whole bunch of offsets might be encoded in
> a single constant vector. If that's the intention, some comments
> explaining this would be good.
Yes, you get the constants from the GLSL compiler in a swizzled
vector, and rather than decoding that I just decided to use index +
I can add a comment about that.
> Also, I thought that the offsets had to be compile-time constants so
> tgsi_texture_offset::File would always be PROGRAM_IMMEDIATE. If
> that's true, why have the File field?
And I think calim's answer is best for that, its what newer DX11 stuff
can do, so I didn't want to revisit it all again in the future.
More information about the mesa-dev