summaryrefslogtreecommitdiff
path: root/source/slang/slang-emit-spirv.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-10-02 15:39:34 -0700
committerGitHub <noreply@github.com>2023-10-02 15:39:34 -0700
commitd87493a46c00be37b820a473c0827bbb865eb222 (patch)
tree33155e6be017238e07314f7793423dd50b748150 /source/slang/slang-emit-spirv.cpp
parentcea230bc686ef87db4cff47e367bbf824b90377d (diff)
More direct-SPIRV fixes. (#3257)
* More direct-SPIRV fixes. * Fix array-reg-to-mem. --------- Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-emit-spirv.cpp')
-rw-r--r--source/slang/slang-emit-spirv.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/source/slang/slang-emit-spirv.cpp b/source/slang/slang-emit-spirv.cpp
index 104fab339..62e7d428b 100644
--- a/source/slang/slang-emit-spirv.cpp
+++ b/source/slang/slang-emit-spirv.cpp
@@ -2274,6 +2274,20 @@ struct SPIRVEmitContext
registerInst(inst, inner);
return inner;
}
+ case kIROp_GetVulkanRayTracingPayloadLocation:
+ {
+ IRInst* location = getVulkanPayloadLocation(inst->getOperand(0));
+ if (!location)
+ {
+ SLANG_DIAGNOSE_UNEXPECTED(m_sink, inst, "no payload location assigned.");
+ IRBuilder builder(inst);
+ builder.setInsertBefore(inst);
+ location = builder.getIntValue(builder.getIntType(), 0);
+ }
+ auto inner = ensureInst(location);
+ registerInst(inst, inner);
+ return inner;
+ }
case kIROp_Return:
if (as<IRReturn>(inst)->getVal()->getOp() == kIROp_VoidLit)
return emitOpReturn(parent, inst);