Commit 1152af7
authored
Fix Sample() with depth texture + sampler comparison state; add minimal repro (#9043)
When something such as
depthTexHandle.SampleCmpLevelZero(samplerComparisonState, ...) was
translated to GLSL, Slangc erroneously translated this as
sampler2DShadowShadow(depthTexHandle,samplerComparisonState, ...). The
first 'Shadow' comes from the depthTexHandle type and the second
'Shadow' comes from the sampler state type (comparison = shadow
sampler).
To fix this while keeping things compatible with the existing use cases,
emit the first 'Shadow' in
GLSLSourceEmitter::_emitGLSLTextureOrTextureSamplerType() only when the
type is a combined texture/sampler type. The sampler state type should
decide the sampler type.
Also, add a minimal repro for this issue.
Fixes #88021 parent 7d05189 commit 1152af7
File tree
2 files changed
+44
-1
lines changed- source/slang
- tests/bugs
2 files changed
+44
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1063 | 1063 | | |
1064 | 1064 | | |
1065 | 1065 | | |
1066 | | - | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
1067 | 1070 | | |
1068 | 1071 | | |
1069 | 1072 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
0 commit comments