summaryrefslogtreecommitdiffstats
path: root/tests/spirv/pointer-array.slang
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-03-03 22:16:49 -0800
committerGitHub <noreply@github.com>2024-03-03 22:16:49 -0800
commitf8c54056048f38369ac93b5da5b823a6f758e227 (patch)
treee9d8e2e1b0c56a8ef7db697c40f2080a7c90cfcc /tests/spirv/pointer-array.slang
parenta4919e3e16d6958b70d665ed682aae910ecf1d4b (diff)
Fix SPIRV pointer codegen. (#3664)
Diffstat (limited to 'tests/spirv/pointer-array.slang')
-rw-r--r--tests/spirv/pointer-array.slang25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/spirv/pointer-array.slang b/tests/spirv/pointer-array.slang
new file mode 100644
index 000000000..6c4050536
--- /dev/null
+++ b/tests/spirv/pointer-array.slang
@@ -0,0 +1,25 @@
+//TEST:SIMPLE(filecheck=CHECK): -target spirv -entry main -stage compute -emit-spirv-directly
+
+
+struct Tester
+{
+ uint i;
+};
+
+struct Push
+{
+ Tester* ptr_array[2];
+ uint * out_ptr;
+};
+
+[[vk::push_constant]] Push p;
+
+// CHECK: OpEntryPoint
+
+[shader("compute")]
+[numthreads(1, 1, 1)]
+void main(int id : SV_DispatchThreadID)
+{
+ uint i = p.ptr_array[0].i;
+ *p.out_ptr = i;
+} \ No newline at end of file