summaryrefslogtreecommitdiff
path: root/source/slang/slang-ir.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-ir.cpp')
-rw-r--r--source/slang/slang-ir.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/slang/slang-ir.cpp b/source/slang/slang-ir.cpp
index ab59112f3..c63ca2bec 100644
--- a/source/slang/slang-ir.cpp
+++ b/source/slang/slang-ir.cpp
@@ -8781,6 +8781,15 @@ IRType* unwrapArray(IRType* type)
return t;
}
+IRType* unwrapArrayAndPointers(IRType* type)
+{
+ if (const auto a = as<IRArrayTypeBase>(type))
+ return unwrapArrayAndPointers(a->getElementType());
+ if (const auto p = as<IRPtrTypeBase>(type))
+ return unwrapArrayAndPointers(p->getValueType());
+ return type;
+}
+
//
// IRTargetIntrinsicDecoration
//