HLSL: add error for expected comparison sampler in SampleCmp* ops
This adds an error message if a non-comparison sampler is used with comparison sampling methods. There's no functional change for correct shaders.
This commit is contained in:
12
Test/hlsl.samplecmp.negative.frag
Normal file
12
Test/hlsl.samplecmp.negative.frag
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
Texture2D g_shadowTex;
|
||||
SamplerState g_shadowSampler;
|
||||
SamplerComparisonState g_shadowSamplerComp;
|
||||
|
||||
float4 main() : SV_Target0
|
||||
{
|
||||
g_shadowTex.SampleCmp(g_shadowSamplerComp, float2(0,0), 0); // OK
|
||||
g_shadowTex.SampleCmp(g_shadowSampler, float2(0,0), 0); // ERROR (should be comparison sampler)
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user