[Mesa-dev] is_tex bit for TGSI sampling instructions
Zack Rusin
zackr at vmware.com
Thu Aug 25 13:46:48 PDT 2011
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
More information about the mesa-dev
mailing list