xref: /aosp_15_r20/external/skia/tests/sksl/shared/OutParamsAreDistinctFromGlobal.hlsl (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1cbuffer _UniformBuffer : register(b0, space0)
2{
3    float4 _11_colorGreen : packoffset(c0);
4    float4 _11_colorRed : packoffset(c1);
5};
6
7
8static float4 sk_FragColor;
9
10struct SPIRV_Cross_Output
11{
12    float4 sk_FragColor : SV_Target0;
13};
14
15static float x = 0.0f;
16
17bool out_params_are_distinct_from_global_bh(out float _27)
18{
19    _27 = 2.0f;
20    bool _36 = false;
21    if (x == 1.0f)
22    {
23        _36 = true;
24    }
25    else
26    {
27        _36 = false;
28    }
29    return _36;
30}
31
32float4 main(float2 _38)
33{
34    x = 1.0f;
35    float _40 = 0.0f;
36    bool _41 = out_params_are_distinct_from_global_bh(_40);
37    x = _40;
38    float4 _43 = 0.0f.xxxx;
39    if (_41)
40    {
41        _43 = _11_colorGreen;
42    }
43    else
44    {
45        _43 = _11_colorRed;
46    }
47    return _43;
48}
49
50void frag_main()
51{
52    float2 _21 = 0.0f.xx;
53    float4 _23 = main(_21);
54    sk_FragColor = _23;
55}
56
57SPIRV_Cross_Output main()
58{
59    frag_main();
60    SPIRV_Cross_Output stage_output;
61    stage_output.sk_FragColor = sk_FragColor;
62    return stage_output;
63}
64