summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authordubiousconst282 <87553666+dubiousconst282@users.noreply.github.com>2025-06-18 21:13:29 -0300
committerGitHub <noreply@github.com>2025-06-19 00:13:29 +0000
commit82418b16a135825e51a2afda3c6a00758615ba27 (patch)
tree9fba759029af20814285010679599cec12535fde /source
parent9bcbf59b6a541ec90e3d3633ec7e53cf1ae3a890 (diff)
Always emit DepthReplacing execution mode when writing to FragDepth (#7450)
Diffstat (limited to 'source')
-rw-r--r--source/slang/slang-emit-spirv.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/source/slang/slang-emit-spirv.cpp b/source/slang/slang-emit-spirv.cpp
index 8e8e7327b..018f833aa 100644
--- a/source/slang/slang-emit-spirv.cpp
+++ b/source/slang/slang-emit-spirv.cpp
@@ -4850,7 +4850,15 @@ struct SPIRVEmitContext : public SourceEmitterBase, public SPIRVEmitSharedContex
if (mode == SpvExecutionModeMax)
return;
- requireSPIRVExecutionMode(nullptr, getIRInstSpvID(entryPoint), mode);
+ // Vulkan spec requires DepthReplacing exec mode when storing to FragDepth,
+ // in addition to DepthLess/DepthGreater modes.
+ requireSPIRVExecutionMode(
+ nullptr,
+ getIRInstSpvID(entryPoint),
+ SpvExecutionModeDepthReplacing);
+
+ if (mode != SpvExecutionModeDepthReplacing)
+ requireSPIRVExecutionMode(nullptr, getIRInstSpvID(entryPoint), mode);
}
// Make user type name conform to `SPV_GOOGLE_user_type` spec.