[Mesa-dev] [PATCH 06/10] i965/fs: Assume shadow sampler swizzling is <X, X, X, 1>.

Eric Anholt eric at anholt.net
Tue Aug 28 10:44:51 PDT 2012


Kenneth Graunke <kenneth at whitecape.org> writes:

> 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?

Of course.  You're right, this is a good way to guess.

> 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.

Yeah, sampling depth directly is used for some soft shadow techniques.
`
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20120828/16ccc943/attachment.pgp>


More information about the mesa-dev mailing list