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.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/source/slang/slang-ir-util.cpp b/source/slang/slang-ir-util.cpp
index d91252fcc..7775fdb91 100644
--- a/source/slang/slang-ir-util.cpp
+++ b/source/slang/slang-ir-util.cpp
@@ -1,4 +1,5 @@
#include "slang-ir-util.h"
+#include "slang-ir-insts.h"
namespace Slang
{
@@ -43,4 +44,24 @@ bool isPtrToArrayType(IRInst* type)
return isPointerOfType(type, kIROp_ArrayType) || isPointerOfType(type, kIROp_UnsizedArrayType);
}
+
+bool isComInterfaceType(IRType* type)
+{
+ if (!type) return false;
+ if (type->findDecoration<IRComInterfaceDecoration>() ||
+ type->getOp() == kIROp_ComPtrType)
+ {
+ return true;
+ }
+
+ if (auto ptrType = as<IRNativePtrType>(type))
+ {
+ auto valueType = ptrType->getValueType();
+ return valueType->findDecoration<IRComInterfaceDecoration>() != nullptr;
+ }
+
+ return false;
+}
+
+
}