mirror of
https://github.com/KhronosGroup/glslang
synced 2024-11-13 21:50:06 +00:00
195f584e09
Texture shadow mode must match the state of the sampler they are combined with. This change does that, both for the AST and the symbol table. Note that the texture cannot easily be *created* the right way, because this may not be known at that time. Instead, the texture is subsequently patched. This cannot work if a single texture is used with both a shadow and non-shadow sampler, so that case is detected and generates an error. This is permitted by the HLSL language, however. See #1073 discussion. Fixed one test source that was using a texture with both shadow and non-shadow samplers.
14 lines
348 B
GLSL
14 lines
348 B
GLSL
|
|
Texture2D g_nonShadowTex;
|
|
Texture2D g_shadowTex;
|
|
SamplerState g_shadowSampler;
|
|
SamplerComparisonState g_shadowSamplerComp;
|
|
|
|
float4 main() : SV_Target0
|
|
{
|
|
g_shadowTex.SampleCmp(g_shadowSamplerComp, float2(0,0), 0); // OK
|
|
g_nonShadowTex.SampleCmp(g_shadowSampler, float2(0,0), 0); // ERROR (should be comparison sampler)
|
|
|
|
return 0;
|
|
}
|