mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-08-06 12:15:43 +00:00
D3D11 only supports HLSL SM5.0 which doesn't support `space` (binding group in WGSL). So for D3D11, only one binding group will be used, and tint will not emit `space` for HLSL, so shaders can be used with D3D11. Bug: dawn:1705 Change-Id: Ie0e9868137f10762c5243e188d76f5e41879c2bc Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/125080 Commit-Queue: Peng Huang <penghuang@chromium.org> Reviewed-by: Ben Clayton <bclayton@google.com> Kokoro: Ben Clayton <bclayton@google.com>
33 lines
964 B
HLSL
33 lines
964 B
HLSL
ByteAddressBuffer firstMatrix : register(t0);
|
|
ByteAddressBuffer secondMatrix : register(t1);
|
|
RWByteAddressBuffer resultMatrix : register(u2);
|
|
cbuffer cbuffer_uniforms : register(b3) {
|
|
uint4 uniforms[2];
|
|
};
|
|
|
|
struct tint_symbol_1 {
|
|
uint3 global_id : SV_DispatchThreadID;
|
|
};
|
|
|
|
void main_inner(uint3 global_id) {
|
|
const uint2 resultCell = uint2(global_id.y, global_id.x);
|
|
const uint dimInner = uniforms[0].y;
|
|
const uint dimOutter = uniforms[1].y;
|
|
uint result = 0u;
|
|
{
|
|
for(uint i = 0u; (i < dimInner); i = (i + 1u)) {
|
|
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));
|
|
}
|
|
|
|
[numthreads(2, 2, 1)]
|
|
void main(tint_symbol_1 tint_symbol) {
|
|
main_inner(tint_symbol.global_id);
|
|
return;
|
|
}
|