[Mesa-dev] is_tex bit for TGSI sampling instructions

Christoph Bumiller e0425955 at student.tuwien.ac.at
Thu Aug 25 14:06:05 PDT 2011

On 25.08.2011 22:46, Zack Rusin wrote:
> On Thursday, August 25, 2011 04:42:21 PM Christoph Bumiller wrote:
>> Of course -4 isn't a valid resource, I just meant to emphasize that I
>> cannot tell at all the resource to be accessed.
>> ADDR[0].x - 4 should of course be >= 0 and valid.
>> And, maybe it seems silly to you, but OpenGL allows it.
>> uniform sampler2D tex[4];
>> uniform int i;
>> ... = texture(tex[i - 4]);
> Nope, that's a sampler, not a resource. The whole point of those instructions 
> is the split between the two (in other words reinterpreting the texture data). 
> Load instruction loads from buffers, i.e. doesn't use samplers. A tgsi sampling  
> instruction for the above would look like:
> SAMPLE DST[0], SRC[0], RES[0], SAMP[ADDR[0] - 4]
> where res is  represent whatever format you want to represents (unorm, snorm, 
> float...)
> z
What ? No.
It would be:
SAMPLE DST[0], SRC[0], RES[ADDR[0] - 4], SAMP[ADDR[0] - 4],
OpenGL does not decouple resources and samplers at GLSL level.

If it was 0 here, you wouldn't be able to access different resources at
all ...
and with resource I mean texture, not texture target.

More information about the mesa-dev mailing list