mirror of
https://github.com/KhronosGroup/glslang
synced 2024-11-13 21:50:06 +00:00
73c57bbe50
A single texture can statically appear in code mixed with a shadow sampler and a non-shadow sampler. This would be create invalid SPIR-V, unless one of them is provably dead. The previous detection of this happened before DCE, so some shaders would trigger the error even though they wouldn't after DCE. To handle that case, this PR splits the texture into two: one with each mode. It sets "needsLegalization" (if that happens for any texture) to warn that this shader will need post-compilation legalization. If the texture is only used with one of the two modes, behavior is as it was before.
15 lines
367 B
GLSL
15 lines
367 B
GLSL
SamplerState g_sSamp : register(s0);
|
|
SamplerComparisonState g_sSampCmp : register(s1);
|
|
|
|
uniform Texture1D <float4> g_tTex : register(t3);
|
|
|
|
float4 main() : SV_Target0
|
|
{
|
|
// This texture is used with both shadow modes. It will need post-compilation
|
|
// legalization.
|
|
g_tTex.SampleCmp(g_sSampCmp, 0.1, 0.75);
|
|
g_tTex.Sample(g_sSamp, 0.1);
|
|
|
|
return 0;
|
|
}
|