From ac6f04c15995061ebe8e0ddf62ecf7eb979afb65 Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 9 Oct 2024 07:35:10 -0700 Subject: Fix spirv lowering logic around pointer to unsized array. (#5243) * Fix spirv lowering logic around pointer to unsized array. * Fix. --------- Co-authored-by: Ellie Hermaszewska --- tests/spirv/ptr-unsized-array.slang | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tests/spirv/ptr-unsized-array.slang (limited to 'tests/spirv/ptr-unsized-array.slang') diff --git a/tests/spirv/ptr-unsized-array.slang b/tests/spirv/ptr-unsized-array.slang new file mode 100644 index 000000000..48added5c --- /dev/null +++ b/tests/spirv/ptr-unsized-array.slang @@ -0,0 +1,23 @@ +//TEST:SIMPLE(filecheck=CHECK): -target spirv + +// CHECK: OpPtrAccessChain + +struct MeshVertex { + float3 Pos; + float2 TexCoord; +}; +struct MeshData { + float4x4 ModelMat; + MeshVertex Vertices[]; +}; +struct DispatchParams { + MeshData* Mesh; + float3* Dest; +}; + +[vk::push_constant] DispatchParams pc; + +[numthreads(64)] +void ComputeMain(uint tid: SV_DispatchThreadID) { + pc.Dest[tid] = pc.Mesh->Vertices[tid].Pos; +} \ No newline at end of file -- cgit v1.2.3