[Mesa-dev] [PATCH 06/10] i965/fs: Assume shadow sampler swizzling is <X, X, X, 1>.
Kenneth Graunke
kenneth at whitecape.org
Mon Aug 27 13:59:02 PDT 2012
On 08/27/2012 01:38 PM, Eric Anholt wrote:
> Kenneth Graunke <kenneth at whitecape.org> writes:
>
>> Our previous assumption, SWIZZLE_XYZW, was completely bogus for depth
>> textures. There are no Y, Z, or W components.
>
> Seems like this doesn't even need to be shadow-sampler-dependent, just
> whether the baseformat is depth/depthstencil.
Except for one problem: the baseformat depends on the currently bound
textures. I doubt people have the correct textures bound at
glLinkShader() time, so we'd be guessing...randomly?
Using the shadow sampler is nice because it's purely based on the
program source. You -know- it's going to be depth/depthstencil.
That said, it would be great to do better: I'm still seeing some
recompiles due to us guessing XYZW instead of XXX1, and I think that's
due to people sampling raw depth values by binding a depth texture to a
regular (non-shadow) sampler.
More information about the mesa-dev
mailing list