summaryrefslogtreecommitdiff
path: root/source/slang/slang-ir-util.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-ir-util.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-ir-util.cpp')
-rw-r--r--source/slang/slang-ir-util.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/source/slang/slang-ir-util.cpp b/source/slang/slang-ir-util.cpp
index b4a41f8a5..5ecbc8121 100644
--- a/source/slang/slang-ir-util.cpp
+++ b/source/slang/slang-ir-util.cpp
@@ -814,6 +814,24 @@ IRInst* findWitnessTableEntry(IRWitnessTable* table, IRInst* key)
return nullptr;
}
+IRInst* getVulkanPayloadLocation(IRInst* payloadGlobalVar)
+{
+ IRInst* location = nullptr;
+ for (auto decor : payloadGlobalVar->getDecorations())
+ {
+ switch (decor->getOp())
+ {
+ case kIROp_VulkanRayPayloadDecoration:
+ case kIROp_VulkanCallablePayloadDecoration:
+ case kIROp_VulkanHitObjectAttributesDecoration:
+ return decor->getOperand(0);
+ default:
+ continue;
+ }
+ }
+ return location;
+}
+
void moveParams(IRBlock* dest, IRBlock* src)
{
for (auto param = src->getFirstChild(); param;)