summaryrefslogtreecommitdiffstats
path: root/tests/spirv/pointer-bug.slang
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-02-21 12:22:31 -0800
committerGitHub <noreply@github.com>2024-02-21 12:22:31 -0800
commitb3b6c44cb8b8ebc413d41f9ca3833d8242f3c805 (patch)
treee73edb286c8179f7fc3677b75bfa2468eb811e60 /tests/spirv/pointer-bug.slang
parent70ea0b048970b9d2e00451636c88313093de2337 (diff)
Fix SPIRV lowering issue. (#3608)
* Fix SPIRV pointer lowering issue. Fixes #3605. * Add another pointer test. Fixes #3601. * Fixes #3600. * Fix #3595.
Diffstat (limited to 'tests/spirv/pointer-bug.slang')
-rw-r--r--tests/spirv/pointer-bug.slang18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/spirv/pointer-bug.slang b/tests/spirv/pointer-bug.slang
new file mode 100644
index 000000000..1668cec13
--- /dev/null
+++ b/tests/spirv/pointer-bug.slang
@@ -0,0 +1,18 @@
+//TEST:SIMPLE(filecheck=CHECK): -target spirv -emit-spirv-directly
+struct Foo {
+ float4 *positions;
+};
+
+struct Params {
+ Foo *foo;
+};
+
+// CHECK: %_ptr_PhysicalStorageBuffer_Foo = OpTypePointer PhysicalStorageBuffer %Foo
+
+[[vk::push_constant]] Params params;
+
+[shader("compute")]
+[numthreads(1,1,1)]
+void main() {
+ params.foo.positions[10] += float4(1, 1, 1, 1);
+} \ No newline at end of file