mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-05-14 19:31:25 +00:00
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>
33 lines
658 B
HLSL
33 lines
658 B
HLSL
cbuffer cbuffer_ubo : register(b0, space0) {
|
|
uint4 ubo[1];
|
|
};
|
|
|
|
struct S {
|
|
int data[64];
|
|
};
|
|
|
|
RWByteAddressBuffer result : register(u1, space0);
|
|
groupshared S s;
|
|
|
|
struct tint_symbol_2 {
|
|
uint local_invocation_index : SV_GroupIndex;
|
|
};
|
|
|
|
void f_inner(uint local_invocation_index) {
|
|
{
|
|
[loop] for(uint idx = local_invocation_index; (idx < 64u); idx = (idx + 1u)) {
|
|
const uint i = idx;
|
|
s.data[i] = 0;
|
|
}
|
|
}
|
|
GroupMemoryBarrierWithGroupSync();
|
|
s.data[asint(ubo[0].x)] = 1;
|
|
result.Store(0u, asuint(s.data[3]));
|
|
}
|
|
|
|
[numthreads(1, 1, 1)]
|
|
void f(tint_symbol_2 tint_symbol_1) {
|
|
f_inner(tint_symbol_1.local_invocation_index);
|
|
return;
|
|
}
|