summaryrefslogtreecommitdiff
path: root/source/slang/slang-ir-util.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-ir-util.cpp')
-rw-r--r--source/slang/slang-ir-util.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/slang/slang-ir-util.cpp b/source/slang/slang-ir-util.cpp
index fda7b25cc..a515217d9 100644
--- a/source/slang/slang-ir-util.cpp
+++ b/source/slang/slang-ir-util.cpp
@@ -12,6 +12,18 @@ bool isPointerOfType(IRInst* type, IROp opCode)
return false;
}
+Dictionary<IRInst*, IRInst*> buildInterfaceRequirementDict(IRInterfaceType* interfaceType)
+{
+ Dictionary<IRInst*, IRInst*> result;
+ for (UInt i = 0; i < interfaceType->getOperandCount(); i++)
+ {
+ auto entry = as<IRInterfaceRequirementEntry>(interfaceType->getOperand(i));
+ if (!entry) continue;
+ result[entry->getRequirementKey()] = entry->getRequirementVal();
+ }
+ return result;
+}
+
bool isPointerOfType(IRInst* type, IRInst* elementType)
{
if (auto ptrType = as<IRPtrTypeBase>(type))