blob: d3daca341e843aaf9ef1c4a907f3ae8eba8e952f [file] [log] [blame]
Ben Clayton009d1292022-02-04 15:39:34 +00001struct strided_arr {
2 @size(8)
James Price3b671cb2022-03-28 14:31:22 +00003 el : f32,
Ben Clayton009d1292022-02-04 15:39:34 +00004}
5
Ben Clayton9dc48bc2023-01-24 14:55:17 +00006alias Arr = array<strided_arr, 2u>;
Ben Clayton009d1292022-02-04 15:39:34 +00007
Ben Clayton9dc48bc2023-01-24 14:55:17 +00008alias Arr_1 = array<Arr, 3u>;
Ben Clayton009d1292022-02-04 15:39:34 +00009
10struct strided_arr_1 {
11 @size(128)
James Price3b671cb2022-03-28 14:31:22 +000012 el : Arr_1,
Ben Clayton009d1292022-02-04 15:39:34 +000013}
14
Ben Clayton9dc48bc2023-01-24 14:55:17 +000015alias Arr_2 = array<strided_arr_1, 4u>;
Ben Clayton009d1292022-02-04 15:39:34 +000016
17struct S {
Ben Claytonefb17b02022-12-01 17:37:56 +000018 /* @offset(0) */
James Price3b671cb2022-03-28 14:31:22 +000019 a : Arr_2,
Ben Clayton009d1292022-02-04 15:39:34 +000020}
21
22@group(0) @binding(0) var<storage, read_write> s : S;
23
24fn f_1() {
James Price506b4f02023-05-23 18:28:44 +000025 let x_19 = s.a;
26 let x_24 = s.a[3i].el;
27 let x_28 = s.a[3i].el[2i];
28 let x_32 = s.a[3i].el[2i][1i].el;
Ben Clayton009d1292022-02-04 15:39:34 +000029 s.a = array<strided_arr_1, 4u>();
Ben Clayton8bd5fec2022-05-31 20:45:59 +000030 s.a[3i].el[2i][1i].el = 5.0f;
Ben Clayton009d1292022-02-04 15:39:34 +000031 return;
32}
33
dan sinclairb29892b2022-06-07 13:55:34 +000034@compute @workgroup_size(1i, 1i, 1i)
Ben Clayton009d1292022-02-04 15:39:34 +000035fn f() {
36 f_1();
37}