summaryrefslogtreecommitdiff
path: root/source/slang/slang-ir.cpp
diff options
context:
space:
mode:
authorEllie Hermaszewska <ellieh@nvidia.com>2025-09-04 04:05:26 +0800
committerGitHub <noreply@github.com>2025-09-03 20:05:26 +0000
commita766d27447aa0fcf69334c0467d9b1124892e180 (patch)
tree67ca5615e4a8c94d7454ee43375eeffc8c8a7d4c /source/slang/slang-ir.cpp
parentbf607e2f3fa183e9a2b18c7a98438a05247d6ed3 (diff)
Diagnose on structured buffers containing resources (#8222)
closes https://github.com/shader-slang/slang/issues/3313
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
//