xref: /aosp_15_r20/external/skia/tests/sksl/shared/DeadStripFunctions.hlsl (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1cbuffer _UniformBuffer : register(b0, space0)
2{
3    float4 _9_colorGreen : packoffset(c0);
4    float4 _9_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 live_fn_h4h4h4(float4 _43, float4 _44)
16{
17    return _43 + _44;
18}
19
20float4 unpremul_h4h4(float4 _24)
21{
22    return float4(_24.xyz * (1.0f / max(_24.w, 9.9999997473787516355514526367188e-05f)), _24.w);
23}
24
25float4 main(float2 _50)
26{
27    float4 _56 = 3.0f.xxxx;
28    float4 _59 = (-5.0f).xxxx;
29    float4 _60 = live_fn_h4h4h4(_56, _59);
30    float4 a = _60;
31    float4 _62 = 1.0f.xxxx;
32    float4 _63 = unpremul_h4h4(_62);
33    float4 b = _63;
34    bool _74 = false;
35    if (any(bool4(_60.x != 0.0f.xxxx.x, _60.y != 0.0f.xxxx.y, _60.z != 0.0f.xxxx.z, _60.w != 0.0f.xxxx.w)))
36    {
37        _74 = any(bool4(_63.x != 0.0f.xxxx.x, _63.y != 0.0f.xxxx.y, _63.z != 0.0f.xxxx.z, _63.w != 0.0f.xxxx.w));
38    }
39    else
40    {
41        _74 = false;
42    }
43    float4 _75 = 0.0f.xxxx;
44    if (_74)
45    {
46        _75 = _9_colorGreen;
47    }
48    else
49    {
50        _75 = _9_colorRed;
51    }
52    return _75;
53}
54
55void frag_main()
56{
57    float2 _19 = 0.0f.xx;
58    sk_FragColor = main(_19);
59}
60
61SPIRV_Cross_Output main()
62{
63    frag_main();
64    SPIRV_Cross_Output stage_output;
65    stage_output.sk_FragColor = sk_FragColor;
66    return stage_output;
67}
68