diff options
| author | Yong He <yonghe@outlook.com> | 2024-10-09 07:35:10 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-09 22:35:10 +0800 |
| commit | ac6f04c15995061ebe8e0ddf62ecf7eb979afb65 (patch) | |
| tree | f16f0f01f1f8d0e73ecd774a22f87576f440f8e8 /tests/spirv | |
| parent | bea1394ad35680940a0b69b9c67efc43764cc194 (diff) | |
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 <ellieh@nvidia.com>
Diffstat (limited to 'tests/spirv')
| -rw-r--r-- | tests/spirv/ptr-unsized-array.slang | 23 |
1 files changed, 23 insertions, 0 deletions
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 |
