summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-12-31 17:47:20 -0800
committerGitHub <noreply@github.com>2025-01-01 01:47:20 +0000
commit075e6c25826cd0a1df26bd36af4afe865673a790 (patch)
tree9df1cd4bcc33025dc6249a806e10e303ec0940b6 /source
parent823b6a84a0252c2977699d64334dadbcb47683bd (diff)
Fix reflection for metal vector [[id]] location. (#5943)
Diffstat (limited to 'source')
-rw-r--r--source/slang/slang-type-layout.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/source/slang/slang-type-layout.cpp b/source/slang/slang-type-layout.cpp
index c6acf5250..98a324d96 100644
--- a/source/slang/slang-type-layout.cpp
+++ b/source/slang/slang-type-layout.cpp
@@ -1898,6 +1898,19 @@ struct MetalArgumentBufferElementLayoutRulesImpl : ObjectLayoutRulesImpl, Defaul
return SimpleLayoutInfo(LayoutResourceKind::MetalArgumentBufferElement, 1);
}
+ SimpleLayoutInfo GetVectorLayout(
+ BaseType elementType,
+ SimpleLayoutInfo elementInfo,
+ size_t elementCount) override
+ {
+ SLANG_UNUSED(elementType);
+ SLANG_UNUSED(elementInfo);
+ SLANG_UNUSED(elementCount);
+
+ // A vector occupies one [[id]] slot in a metal argument buffer.
+ return SimpleLayoutInfo(LayoutResourceKind::MetalArgumentBufferElement, 1);
+ }
+
virtual ObjectLayoutInfo GetObjectLayout(ShaderParameterKind kind, const Options& /* options */)
override
{