summaryrefslogtreecommitdiff
path: root/tests/metal
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2025-01-10 10:58:12 -0800
committerGitHub <noreply@github.com>2025-01-10 10:58:12 -0800
commit54845333858579f66bfa7c42bbf0b8e1317206ce (patch)
tree00f98ed560d06ed1cfcf9db01f02043b3f19af05 /tests/metal
parent5290c580632cfb56847b863a32dc020a21d1c93e (diff)
Fix Metal type layout reflection for nested parameter blocks. (#6042)
Diffstat (limited to 'tests/metal')
-rw-r--r--tests/metal/nested-parameter-block-reflection.slang18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/metal/nested-parameter-block-reflection.slang b/tests/metal/nested-parameter-block-reflection.slang
new file mode 100644
index 000000000..8282f5573
--- /dev/null
+++ b/tests/metal/nested-parameter-block-reflection.slang
@@ -0,0 +1,18 @@
+//TEST:REFLECTION(filecheck=CHECK): -target metal
+
+// CHECK:"name": "tex",
+// CHECK:"binding": {"kind": "metalArgumentBufferElement", "index": 1}
+
+struct Data { int3 content; }
+struct Params
+{
+ ParameterBlock<Data> pdata;
+ Texture2D tex;
+}
+ParameterBlock<Params> gParams;
+RWStructuredBuffer<float4> output;
+[numthreads(1,1,1)]
+void computeMain()
+{
+ output[0] = gParams.tex.Load(gParams.pdata.content);
+} \ No newline at end of file