DaveBaumann said:
It may be valid, its just not defined by DX documentation - as far as we've discussed with one developer, the what's applied to a D24S8 in these circumstances is very different from other hardware, and not documentmented within directx.
What Dave's getting at (I believe) is that the implicit comparision in the look up used in NVIDIA usage of DST is clearly outside of the 'normal' DX usage (its not out of spec as there is no specification in this case but its clearly against the grain).
To understand why, ask your self what wrong with this (apart from it being psuedo code)?
// pixel shader code
sampler DSTTexture : register(s0);
float4 CopyStencilToColour( ... )
{
// a DST texture contains the depth in x and stencil in y
float2 ds = tex2D( DSTTexture, uv );
return ds.yyyy;
}
float4 UseDepthToLookupSomething( ... )
{
// a DST texture contains the depth in x and stencil in y
float2 ds = tex2D( DSTTexture, uv );
// depth should be a smooth [0,1] based on distance
return tex2D( LookupTable, ds.xx );
}
The answer oddly is NOTHING, they are absolutely valid and should be the behaviour of a card that claims support for D3DFMT_D24S8.
Being a complete idiot and having never heard of NVIDIA why can't I assume that a D3DFMT_D24S8 texture returns a normalised depth and normalised stencil value as a texture as is indicated by the D3DFMT_D24S8 code?
Personally I'd much rather NVIDIA have exposed DST/PCF via a FOURCC code (which is what they are for) but I assume there was/is a problem in the SetDepthStencil API that stops them doing that (possible MS check the format before they get a chance to work with it...)