From b3b6c44cb8b8ebc413d41f9ca3833d8242f3c805 Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 21 Feb 2024 12:22:31 -0800 Subject: Fix SPIRV lowering issue. (#3608) * Fix SPIRV pointer lowering issue. Fixes #3605. * Add another pointer test. Fixes #3601. * Fixes #3600. * Fix #3595. --- tests/spirv/pointer-bug.slang | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 tests/spirv/pointer-bug.slang (limited to 'tests/spirv/pointer-bug.slang') 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 -- cgit v1.2.3