2022-02-04 15:39:34 +00:00
|
|
|
struct strided_arr {
|
2021-07-27 08:17:29 +00:00
|
|
|
float2 el;
|
|
|
|
};
|
|
|
|
|
|
|
|
RWByteAddressBuffer ssbo : register(u0, space0);
|
|
|
|
|
2022-02-04 15:39:34 +00:00
|
|
|
float2x2 arr_to_mat2x2_stride_16(strided_arr arr[2]) {
|
2021-07-27 08:17:29 +00:00
|
|
|
return float2x2(arr[0u].el, arr[1u].el);
|
|
|
|
}
|
|
|
|
|
2022-02-04 15:39:34 +00:00
|
|
|
typedef strided_arr mat2x2_stride_16_to_arr_ret[2];
|
2022-02-17 20:43:19 +00:00
|
|
|
mat2x2_stride_16_to_arr_ret mat2x2_stride_16_to_arr(float2x2 m) {
|
2023-03-08 21:48:45 +00:00
|
|
|
const strided_arr tint_symbol = {m[0u]};
|
|
|
|
const strided_arr tint_symbol_1 = {m[1u]};
|
|
|
|
const strided_arr tint_symbol_2[2] = {tint_symbol, tint_symbol_1};
|
|
|
|
return tint_symbol_2;
|
2021-07-27 08:17:29 +00:00
|
|
|
}
|
|
|
|
|
2023-02-24 17:16:55 +00:00
|
|
|
strided_arr ssbo_load_1(uint offset) {
|
2023-03-08 21:48:45 +00:00
|
|
|
const strided_arr tint_symbol_3 = {asfloat(ssbo.Load2((offset + 0u)))};
|
|
|
|
return tint_symbol_3;
|
2022-02-04 15:39:34 +00:00
|
|
|
}
|
|
|
|
|
2023-02-24 17:16:55 +00:00
|
|
|
typedef strided_arr ssbo_load_ret[2];
|
|
|
|
ssbo_load_ret ssbo_load(uint offset) {
|
2022-02-04 15:39:34 +00:00
|
|
|
strided_arr arr_1[2] = (strided_arr[2])0;
|
2021-07-27 08:17:29 +00:00
|
|
|
{
|
2022-09-29 16:53:58 +00:00
|
|
|
for(uint i = 0u; (i < 2u); i = (i + 1u)) {
|
2023-02-24 17:16:55 +00:00
|
|
|
arr_1[i] = ssbo_load_1((offset + (i * 16u)));
|
2021-07-27 08:17:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return arr_1;
|
|
|
|
}
|
|
|
|
|
2023-02-24 17:16:55 +00:00
|
|
|
void ssbo_store_1(uint offset, strided_arr value) {
|
|
|
|
ssbo.Store2((offset + 0u), asuint(value.el));
|
2022-02-04 15:39:34 +00:00
|
|
|
}
|
|
|
|
|
2023-02-24 17:16:55 +00:00
|
|
|
void ssbo_store(uint offset, strided_arr value[2]) {
|
2023-02-14 13:52:43 +00:00
|
|
|
strided_arr array_1[2] = value;
|
2021-07-27 08:17:29 +00:00
|
|
|
{
|
2022-09-29 16:53:58 +00:00
|
|
|
for(uint i_1 = 0u; (i_1 < 2u); i_1 = (i_1 + 1u)) {
|
2023-02-24 17:16:55 +00:00
|
|
|
ssbo_store_1((offset + (i_1 * 16u)), array_1[i_1]);
|
2021-07-27 08:17:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void f_1() {
|
2023-02-24 17:16:55 +00:00
|
|
|
const float2x2 x_15 = arr_to_mat2x2_stride_16(ssbo_load(0u));
|
2023-03-08 21:48:45 +00:00
|
|
|
ssbo_store(0u, mat2x2_stride_16_to_arr(x_15));
|
2021-07-27 08:17:29 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
[numthreads(1, 1, 1)]
|
|
|
|
void f() {
|
|
|
|
f_1();
|
|
|
|
return;
|
|
|
|
}
|