summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-emit-spirv.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-emit-spirv.cpp')
-rw-r--r--source/slang/slang-emit-spirv.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/slang/slang-emit-spirv.cpp b/source/slang/slang-emit-spirv.cpp
index b3232de93..36368c3ee 100644
--- a/source/slang/slang-emit-spirv.cpp
+++ b/source/slang/slang-emit-spirv.cpp
@@ -2681,7 +2681,11 @@ struct SPIRVEmitContext : public SourceEmitterBase, public SPIRVEmitSharedContex
// Vulkan spec 16.1: "The “Depth” operand of OpTypeImage is ignored."
SpvWord depth =
- ImageOpConstants::unknownDepthImage; // No knowledge of if this is a depth image
+ inst->isShadow()
+ ? ImageOpConstants::isDepthImage // But we respect the `isShadow` flag of the
+ // texture
+ : ImageOpConstants::unknownDepthImage; // No knowledge of if this is a depth image
+
SpvWord ms = inst->isMultisample() ? ImageOpConstants::isMultisampled
: ImageOpConstants::notMultisampled;