HLSL: split textures used for both shadow and non-shadow modes
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.
Showing
- Test/baseResults/hlsl.samplecmp.dualmode.frag.out 157 additions, 0 deletionsTest/baseResults/hlsl.samplecmp.dualmode.frag.out
- Test/hlsl.samplecmp.dualmode.frag 14 additions, 0 deletionsTest/hlsl.samplecmp.dualmode.frag
- glslang/Include/intermediate.h 1 addition, 0 deletionsglslang/Include/intermediate.h
- gtests/Hlsl.FromFile.cpp 1 addition, 0 deletionsgtests/Hlsl.FromFile.cpp
- hlsl/hlslParseHelper.cpp 62 additions, 28 deletionshlsl/hlslParseHelper.cpp
- hlsl/hlslParseHelper.h 23 additions, 4 deletionshlsl/hlslParseHelper.h
Loading
Please register or sign in to comment