xref: /aosp_15_r20/external/skia/tests/sksl/shared/TernaryNesting.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 _33 = float4(0.0f, 0.0f, _7_colorWhite.zw);
17    float4 colorBlue = _33;
18    float4 _41 = float4(0.0f, _7_colorWhite.y, 0.0f, _7_colorWhite.w);
19    float4 colorGreen = _41;
20    float4 _49 = float4(_7_colorWhite.x, 0.0f, 0.0f, _7_colorWhite.w);
21    float4 colorRed = _49;
22    float4 _57 = 0.0f.xxxx;
23    if (any(bool4(_7_colorWhite.x != _33.x, _7_colorWhite.y != _33.y, _7_colorWhite.z != _33.z, _7_colorWhite.w != _33.w)))
24    {
25        float4 _63 = 0.0f.xxxx;
26        if (all(bool4(_41.x == _49.x, _41.y == _49.y, _41.z == _49.z, _41.w == _49.w)))
27        {
28            _63 = _49;
29        }
30        else
31        {
32            _63 = _41;
33        }
34        _57 = _63;
35    }
36    else
37    {
38        float4 _70 = 0.0f.xxxx;
39        if (any(bool4(_49.x != _41.x, _49.y != _41.y, _49.z != _41.z, _49.w != _41.w)))
40        {
41            _70 = _33;
42        }
43        else
44        {
45            _70 = _7_colorWhite;
46        }
47        _57 = _70;
48    }
49    float4 result = _57;
50    float4 _80 = 0.0f.xxxx;
51    if (all(bool4(_49.x == _33.x, _49.y == _33.y, _49.z == _33.z, _49.w == _33.w)))
52    {
53        _80 = _7_colorWhite;
54    }
55    else
56    {
57        float4 _88 = 0.0f.xxxx;
58        if (any(bool4(_49.x != _41.x, _49.y != _41.y, _49.z != _41.z, _49.w != _41.w)))
59        {
60            _88 = _57;
61        }
62        else
63        {
64            float4 _96 = 0.0f.xxxx;
65            if (all(bool4(_49.x == _7_colorWhite.x, _49.y == _7_colorWhite.y, _49.z == _7_colorWhite.z, _49.w == _7_colorWhite.w)))
66            {
67                _96 = _33;
68            }
69            else
70            {
71                _96 = _49;
72            }
73            _88 = _96;
74        }
75        _80 = _88;
76    }
77    return _80;
78}
79
80void frag_main()
81{
82    float2 _17 = 0.0f.xx;
83    sk_FragColor = main(_17);
84}
85
86SPIRV_Cross_Output main()
87{
88    frag_main();
89    SPIRV_Cross_Output stage_output;
90    stage_output.sk_FragColor = sk_FragColor;
91    return stage_output;
92}
93