xref: /aosp_15_r20/external/skia/tests/sksl/shared/IfStatement.hlsl (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1cbuffer _UniformBuffer : register(b0, space0)
2{
3    float4 _8_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 ifElseTest_h4h4h4h4(float4 _23, float4 _24, float4 _25)
15{
16    float4 result = 0.0f.xxxx;
17    if (any(bool4(_8_colorWhite.x != _23.x, _8_colorWhite.y != _23.y, _8_colorWhite.z != _23.z, _8_colorWhite.w != _23.w)))
18    {
19        if (all(bool4(_24.x == _25.x, _24.y == _25.y, _24.z == _25.z, _24.w == _25.w)))
20        {
21            result = _25;
22        }
23        else
24        {
25            result = _24;
26        }
27    }
28    else
29    {
30        if (any(bool4(_25.x != _24.x, _25.y != _24.y, _25.z != _24.z, _25.w != _24.w)))
31        {
32            result = _23;
33        }
34        else
35        {
36            result = _8_colorWhite;
37        }
38    }
39    if (all(bool4(_25.x == _23.x, _25.y == _23.y, _25.z == _23.z, _25.w == _23.w)))
40    {
41        return _8_colorWhite;
42    }
43    if (any(bool4(_25.x != _24.x, _25.y != _24.y, _25.z != _24.z, _25.w != _24.w)))
44    {
45        return result;
46    }
47    if (all(bool4(_25.x == _8_colorWhite.x, _25.y == _8_colorWhite.y, _25.z == _8_colorWhite.z, _25.w == _8_colorWhite.w)))
48    {
49        return _23;
50    }
51    return _25;
52}
53
54float4 main(float2 _86)
55{
56    float4 _93 = float4(0.0f, 0.0f, _8_colorWhite.z, 1.0f);
57    float4 _98 = float4(0.0f, _8_colorWhite.y, 0.0f, 1.0f);
58    float4 _103 = float4(_8_colorWhite.x, 0.0f, 0.0f, 1.0f);
59    return ifElseTest_h4h4h4h4(_93, _98, _103);
60}
61
62void frag_main()
63{
64    float2 _18 = 0.0f.xx;
65    sk_FragColor = main(_18);
66}
67
68SPIRV_Cross_Output main()
69{
70    frag_main();
71    SPIRV_Cross_Output stage_output;
72    stage_output.sk_FragColor = sk_FragColor;
73    return stage_output;
74}
75