dawn-cmake/test/bug/tint/413.spvasm.expected.hlsl
Ben Clayton 0e41747281 writer/hlsl: Emit for-loops where possible.
Use the new transforms to try and simplify loops into for-loops.
Emit loops when the initialiser, condition and continuing are simple enough to do so.

Bug: tint:952
Change-Id: I5b3c225b245ffa72996abf6a70f52a9cd25b748e
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/56772
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: David Neto <dneto@google.com>
2021-07-02 22:17:25 +00:00

19 lines
386 B
HLSL

Texture2D<uint4> Src : register(t0, space0);
RWTexture2D<uint4> Dst : register(u1, space0);
void main_1() {
uint4 srcValue = uint4(0u, 0u, 0u, 0u);
const uint4 x_18 = Src.Load(int3(0, 0, 0));
srcValue = x_18;
const uint x_22 = srcValue.x;
srcValue.x = (x_22 + asuint(1));
Dst[int2(0, 0)] = srcValue;
return;
}
[numthreads(1, 1, 1)]
void main() {
main_1();
return;
}