summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-ir-util.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-04-17 21:32:28 -0700
committerGitHub <noreply@github.com>2024-04-17 21:32:28 -0700
commit2c66cc7ef03b4d38fc463f2c8609a81232fcb91a (patch)
tree7e100ddd0df91e8d7ae90c3335bb416bc50ad6ac /source/slang/slang-ir-util.cpp
parent4b3f554a58e4224806c31d66874fbe60f1f09332 (diff)
Add skeleton for metal backend. (#3971)
Diffstat (limited to 'source/slang/slang-ir-util.cpp')
-rw-r--r--source/slang/slang-ir-util.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/slang/slang-ir-util.cpp b/source/slang/slang-ir-util.cpp
index 380d1141e..eaf254190 100644
--- a/source/slang/slang-ir-util.cpp
+++ b/source/slang/slang-ir-util.cpp
@@ -16,6 +16,13 @@ bool isPointerOfType(IRInst* type, IROp opCode)
return false;
}
+IRType* getVectorElementType(IRType* type)
+{
+ if (auto vectorType = as<IRVectorType>(type))
+ return vectorType->getElementType();
+ return type;
+}
+
Dictionary<IRInst*, IRInst*> buildInterfaceRequirementDict(IRInterfaceType* interfaceType)
{
Dictionary<IRInst*, IRInst*> result;