diff options
| author | Yong He <yonghe@outlook.com> | 2024-10-21 08:49:15 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-21 08:49:15 -0700 |
| commit | 3e84726f45c66b477569be9e62da71956ab78e94 (patch) | |
| tree | 8c69306133ee04b6acd14dd07d12a0ed47bf0079 /tests/spirv/ptr-empty-struct.slang | |
| parent | 20fa42e82dfa8398c9c818773fa40817883fb7ec (diff) | |
Fix spirv codegen for pointer to empty structs. (#5355)
Diffstat (limited to 'tests/spirv/ptr-empty-struct.slang')
| -rw-r--r-- | tests/spirv/ptr-empty-struct.slang | 15 |
1 files changed, 15 insertions, 0 deletions
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<int> outputBuffer; + +[numthreads(64)] +void ComputeMain(uint tid: SV_DispatchThreadID) { + outputBuffer[tid] = ((int*)(pc))[0]; +}
\ No newline at end of file |
