From 3e84726f45c66b477569be9e62da71956ab78e94 Mon Sep 17 00:00:00 2001 From: Yong He Date: Mon, 21 Oct 2024 08:49:15 -0700 Subject: Fix spirv codegen for pointer to empty structs. (#5355) --- tests/spirv/ptr-empty-struct.slang | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 tests/spirv/ptr-empty-struct.slang (limited to 'tests/spirv/ptr-empty-struct.slang') diff --git a/tests/spirv/ptr-empty-struct.slang b/tests/spirv/ptr-empty-struct.slang new file mode 100644 index 000000000..56148592b --- /dev/null +++ b/tests/spirv/ptr-empty-struct.slang @@ -0,0 +1,15 @@ +//TEST:SIMPLE(filecheck=CHECK): -target spirv + +// CHECK: OpPtrAccessChain + +struct EmptyStruct { +}; + +[vk::push_constant] EmptyStruct* pc; + +RWStructuredBuffer outputBuffer; + +[numthreads(64)] +void ComputeMain(uint tid: SV_DispatchThreadID) { + outputBuffer[tid] = ((int*)(pc))[0]; +} \ No newline at end of file -- cgit v1.2.3