Commit Graph

1 Commits

Author SHA1 Message Date
LoopDawg
73c57bbe50 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.
2017-10-06 11:23:16 -06:00