diff options
| author | Tim Foley <tfoleyNV@users.noreply.github.com> | 2018-04-18 12:57:34 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-04-18 12:57:34 -0700 |
| commit | 0450ca61e27dd0ee0ae744aa98426621627897a1 (patch) | |
| tree | 7ada84c02543747be4739945dcda63ef9050d2e5 | |
| parent | 00389a127af8db18a3ec8fe7ad2dd114a65ac024 (diff) | |
Fix some logic around legalization of sampler types (#496)
The main error here was checking for `IRSamplerType` instead of `IRSamplerTypeBase`, which means the relevant logic only triggered for the `SamplerState` type and not the `SamplerComparisonState` type.
The two affected places were type legalization (so that comparison samplers in `struct` types weren't being hoisted out) and the emit logic when deciding whether to introduce local temporaries (so we were emitting temporaries for comparison samplers, leading to GLSL errors).
| -rw-r--r-- | source/slang/emit.cpp | 2 | ||||
| -rw-r--r-- | source/slang/legalize-types.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/source/slang/emit.cpp b/source/slang/emit.cpp index 28fb0b551..e86a6d1e4 100644 --- a/source/slang/emit.cpp +++ b/source/slang/emit.cpp @@ -2076,7 +2076,7 @@ struct EmitVisitor { return true; } - else if(as<IRSamplerStateType>(type)) + else if(as<IRSamplerStateTypeBase>(type)) { return true; } diff --git a/source/slang/legalize-types.cpp b/source/slang/legalize-types.cpp index 51a7af314..6922a5174 100644 --- a/source/slang/legalize-types.cpp +++ b/source/slang/legalize-types.cpp @@ -88,7 +88,7 @@ static bool isResourceType(IRType* type) { return true; } - else if (auto samplerType = as<IRSamplerStateType>(type)) + else if (auto samplerType = as<IRSamplerStateTypeBase>(type)) { return true; } |
