xref: /aosp_15_r20/external/skia/tests/sksl/shared/TernaryExpression.hlsl (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1cbuffer _UniformBuffer : register(b0, space0)
2{
3    float4 _7_colorGreen : packoffset(c0);
4    float4 _7_colorRed : packoffset(c1);
5};
6
7
8static float4 sk_FragColor;
9
10struct SPIRV_Cross_Output
11{
12    float4 sk_FragColor : SV_Target0;
13};
14
15float4 main(float2 _21)
16{
17    int check = 0;
18    int _36 = 0 + ((_7_colorGreen.y == 1.0f) ? 0 : 1);
19    check = _36;
20    int _42 = _36 + int(_7_colorGreen.x == 1.0f);
21    check = _42;
22    int _53 = _42 + (all(bool2(_7_colorGreen.yx.x == _7_colorRed.xy.x, _7_colorGreen.yx.y == _7_colorRed.xy.y)) ? 0 : 1);
23    check = _53;
24    int _63 = _53 + int(any(bool2(_7_colorGreen.yx.x != _7_colorRed.xy.x, _7_colorGreen.yx.y != _7_colorRed.xy.y)));
25    check = _63;
26    float4 _65 = 0.0f.xxxx;
27    if (_63 == 0)
28    {
29        _65 = _7_colorGreen;
30    }
31    else
32    {
33        _65 = _7_colorRed;
34    }
35    return _65;
36}
37
38void frag_main()
39{
40    float2 _17 = 0.0f.xx;
41    sk_FragColor = main(_17);
42}
43
44SPIRV_Cross_Output main()
45{
46    frag_main();
47    SPIRV_Cross_Output stage_output;
48    stage_output.sk_FragColor = sk_FragColor;
49    return stage_output;
50}
51