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.
This commit is contained in:
parent
263986eb6e
commit
73c57bbe50
6 changed files with 260 additions and 34 deletions
|
|
@ -979,6 +979,7 @@ public:
|
|||
constSubtree(nullptr)
|
||||
{ name = n; }
|
||||
virtual int getId() const { return id; }
|
||||
virtual void setId(int newId) { id = newId; }
|
||||
virtual const TString& getName() const { return name; }
|
||||
virtual void traverse(TIntermTraverser*);
|
||||
virtual TIntermSymbol* getAsSymbolNode() { return this; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue