xref: /aosp_15_r20/external/skia/tests/sksl/shared/ForLoopControlFlow.hlsl (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1cbuffer _UniformBuffer : register(b0, space0)
2{
3    float4 _7_colorWhite : packoffset(c0);
4};
5
6
7static float4 sk_FragColor;
8
9struct SPIRV_Cross_Output
10{
11    float4 sk_FragColor : SV_Target0;
12};
13
14float4 main(float2 _21)
15{
16    float4 x = _7_colorWhite;
17    for (float r = -5.0f; r < 5.0f; r += 1.0f)
18    {
19        x.x = clamp(r, 0.0f, 1.0f);
20        if (x.x == 0.0f)
21        {
22            break;
23        }
24    }
25    for (float b = 5.0f; b >= 0.0f; b -= 1.0f)
26    {
27        x.z = b;
28        if (x.w == 1.0f)
29        {
30            continue;
31        }
32        x.y = 0.0f;
33    }
34    return x;
35}
36
37void frag_main()
38{
39    float2 _17 = 0.0f.xx;
40    sk_FragColor = main(_17);
41}
42
43SPIRV_Cross_Output main()
44{
45    frag_main();
46    SPIRV_Cross_Output stage_output;
47    stage_output.sk_FragColor = sk_FragColor;
48    return stage_output;
49}
50