[Mesa-dev] is_tex bit for TGSI sampling instructions
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.x - 4 should of course be >= 0 and valid.
> And, maybe it seems silly to you, but OpenGL allows it.
> uniform sampler2D tex;
> 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, SRC, RES, SAMP[ADDR - 4]
where res is represent whatever format you want to represents (unorm, snorm,
More information about the mesa-dev