summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-type-layout.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-type-layout.cpp')
-rw-r--r--source/slang/slang-type-layout.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/source/slang/slang-type-layout.cpp b/source/slang/slang-type-layout.cpp
index 9551cfe4e..ff1f2c147 100644
--- a/source/slang/slang-type-layout.cpp
+++ b/source/slang/slang-type-layout.cpp
@@ -366,6 +366,25 @@ struct CPULayoutRulesImpl : DefaultLayoutRulesImpl
}
}
+ SimpleArrayLayoutInfo GetArrayLayout( SimpleLayoutInfo elementInfo, LayoutSize elementCount) override
+ {
+ if (elementCount.isInfinite())
+ {
+ // This is an unsized array, get information for element
+ auto info = Super::GetArrayLayout(elementInfo, LayoutSize(1));
+
+ // So it is actually a Array<T> on CPU which is a pointer and a size
+ info.size = sizeof(void*) * 2;
+ info.alignment = sizeof(void*);
+
+ return info;
+ }
+ else
+ {
+ return Super::GetArrayLayout(elementInfo, elementCount);
+ }
+ }
+
UniformLayoutInfo BeginStructLayout() override
{
return Super::BeginStructLayout();