dawn-cmake/test/bug/tint/744.wgsl.expected.hlsl
Antonio Maiorano e2528e9297 Reland "HLSL: force FXC to never unroll loops"
Now that I've landed this change to Dawn to disable FXC optimizations:
https://dawn-review.googlesource.com/c/dawn/+/70700,, we can reland this
change. The Tint-into-Dawn roll was failing because FXC would miscompile
certain loops into infinite loops when not unrolled.

Also reland
test/bug/fxc/gradient_in_varying_loop/1112.wgsl.expected.hlsl

Bug: tint:1112
Bug: dawn:1203
Change-Id: I641d68864b833e0fbe3b117d397b89ae96482536
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/71000
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
2021-11-25 18:44:50 +00:00

33 lines
1003 B
HLSL

ByteAddressBuffer firstMatrix : register(t0, space0);
ByteAddressBuffer secondMatrix : register(t1, space0);
RWByteAddressBuffer resultMatrix : register(u2, space0);
cbuffer cbuffer_uniforms : register(b3, space0) {
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;
{
[loop] 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;
}