summaryrefslogtreecommitdiffstats
path: root/tests/spirv/ptr-unsized-array.slang
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-10-09 07:35:10 -0700
committerGitHub <noreply@github.com>2024-10-09 22:35:10 +0800
commitac6f04c15995061ebe8e0ddf62ecf7eb979afb65 (patch)
treef16f0f01f1f8d0e73ecd774a22f87576f440f8e8 /tests/spirv/ptr-unsized-array.slang
parentbea1394ad35680940a0b69b9c67efc43764cc194 (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/ptr-unsized-array.slang')
-rw-r--r--tests/spirv/ptr-unsized-array.slang23
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