Ben Clayton | 009d129 | 2022-02-04 15:39:34 +0000 | [diff] [blame] | 1 | struct strided_arr { |
| 2 | @size(8) |
James Price | 3b671cb | 2022-03-28 14:31:22 +0000 | [diff] [blame] | 3 | el : f32, |
Ben Clayton | 009d129 | 2022-02-04 15:39:34 +0000 | [diff] [blame] | 4 | } |
| 5 | |
Ben Clayton | 9dc48bc | 2023-01-24 14:55:17 +0000 | [diff] [blame] | 6 | alias Arr = array<strided_arr, 2u>; |
Ben Clayton | 009d129 | 2022-02-04 15:39:34 +0000 | [diff] [blame] | 7 | |
Ben Clayton | 9dc48bc | 2023-01-24 14:55:17 +0000 | [diff] [blame] | 8 | alias Arr_1 = array<Arr, 3u>; |
Ben Clayton | 009d129 | 2022-02-04 15:39:34 +0000 | [diff] [blame] | 9 | |
| 10 | struct strided_arr_1 { |
| 11 | @size(128) |
James Price | 3b671cb | 2022-03-28 14:31:22 +0000 | [diff] [blame] | 12 | el : Arr_1, |
Ben Clayton | 009d129 | 2022-02-04 15:39:34 +0000 | [diff] [blame] | 13 | } |
| 14 | |
Ben Clayton | 9dc48bc | 2023-01-24 14:55:17 +0000 | [diff] [blame] | 15 | alias Arr_2 = array<strided_arr_1, 4u>; |
Ben Clayton | 009d129 | 2022-02-04 15:39:34 +0000 | [diff] [blame] | 16 | |
| 17 | struct S { |
Ben Clayton | efb17b0 | 2022-12-01 17:37:56 +0000 | [diff] [blame] | 18 | /* @offset(0) */ |
James Price | 3b671cb | 2022-03-28 14:31:22 +0000 | [diff] [blame] | 19 | a : Arr_2, |
Ben Clayton | 009d129 | 2022-02-04 15:39:34 +0000 | [diff] [blame] | 20 | } |
| 21 | |
| 22 | @group(0) @binding(0) var<storage, read_write> s : S; |
| 23 | |
| 24 | fn f_1() { |
James Price | 506b4f0 | 2023-05-23 18:28:44 +0000 | [diff] [blame] | 25 | 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 Clayton | 009d129 | 2022-02-04 15:39:34 +0000 | [diff] [blame] | 29 | s.a = array<strided_arr_1, 4u>(); |
Ben Clayton | 8bd5fec | 2022-05-31 20:45:59 +0000 | [diff] [blame] | 30 | s.a[3i].el[2i][1i].el = 5.0f; |
Ben Clayton | 009d129 | 2022-02-04 15:39:34 +0000 | [diff] [blame] | 31 | return; |
| 32 | } |
| 33 | |
dan sinclair | b29892b | 2022-06-07 13:55:34 +0000 | [diff] [blame] | 34 | @compute @workgroup_size(1i, 1i, 1i) |
Ben Clayton | 009d129 | 2022-02-04 15:39:34 +0000 | [diff] [blame] | 35 | fn f() { |
| 36 | f_1(); |
| 37 | } |