summaryrefslogtreecommitdiff
path: root/tests/spirv/ptr-unsized-array.slang
diff options
context:
space:
mode:
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