2021-05-20 21:31:37 +00:00
|
|
|
ByteAddressBuffer firstMatrix : register(t0, space0);
|
|
|
|
ByteAddressBuffer secondMatrix : register(t1, space0);
|
|
|
|
RWByteAddressBuffer resultMatrix : register(u2, space0);
|
2021-06-18 21:15:25 +00:00
|
|
|
cbuffer cbuffer_uniforms : register(b3, space0) {
|
|
|
|
uint4 uniforms[2];
|
|
|
|
};
|
2021-06-16 09:19:36 +00:00
|
|
|
|
|
|
|
struct tint_symbol_1 {
|
|
|
|
uint3 global_id : SV_DispatchThreadID;
|
|
|
|
};
|
2021-05-20 21:31:37 +00:00
|
|
|
|
2021-08-04 22:15:28 +00:00
|
|
|
void main_inner(uint3 global_id) {
|
2021-05-20 21:31:37 +00:00
|
|
|
const uint2 resultCell = uint2(global_id.y, global_id.x);
|
2021-07-13 12:18:13 +00:00
|
|
|
const uint dimInner = uniforms[0].y;
|
|
|
|
const uint dimOutter = uniforms[1].y;
|
2021-05-20 21:31:37 +00:00
|
|
|
uint result = 0u;
|
|
|
|
{
|
2022-09-29 16:53:58 +00:00
|
|
|
for(uint i = 0u; (i < dimInner); i = (i + 1u)) {
|
2021-05-20 21:31:37 +00:00
|
|
|
const uint a = (i + (resultCell.x * dimInner));
|
|
|
|
const uint b = (resultCell.y + (i * dimOutter));
|
|
|
|
result = (result + (firstMatrix.Load((4u * a)) * secondMatrix.Load((4u * b))));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const uint index = (resultCell.y + (resultCell.x * dimOutter));
|
|
|
|
resultMatrix.Store((4u * index), asuint(result));
|
2021-08-04 22:15:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
[numthreads(2, 2, 1)]
|
|
|
|
void main(tint_symbol_1 tint_symbol) {
|
|
|
|
main_inner(tint_symbol.global_id);
|
2021-05-20 21:31:37 +00:00
|
|
|
return;
|
|
|
|
}
|