xref: /aosp_15_r20/external/skia/tests/sksl/intrinsics/Length.hlsl (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1cbuffer _UniformBuffer : register(b0, space0)
2{
3    float4 _7_testMatrix2x2 : packoffset(c0);
4    float4 _7_colorGreen : packoffset(c1);
5    float4 _7_colorRed : packoffset(c2);
6};
7
8
9static float4 sk_FragColor;
10
11struct SPIRV_Cross_Output
12{
13    float4 sk_FragColor : SV_Target0;
14};
15
16float4 main(float2 _21)
17{
18    float4 _35 = _7_testMatrix2x2 + float4(2.0f, -2.0f, 1.0f, 8.0f);
19    float4 inputVal = _35;
20    float4 expected = float4(3.0f, 3.0f, 5.0f, 13.0f);
21    bool _56 = false;
22    if (abs(length(_35.x) - 3.0f) < 0.0500000007450580596923828125f)
23    {
24        _56 = abs(length(_35.xy) - 3.0f) < 0.0500000007450580596923828125f;
25    }
26    else
27    {
28        _56 = false;
29    }
30    bool _65 = false;
31    if (_56)
32    {
33        _65 = abs(length(_35.xyz) - 5.0f) < 0.0500000007450580596923828125f;
34    }
35    else
36    {
37        _65 = false;
38    }
39    bool _72 = false;
40    if (_65)
41    {
42        _72 = abs(length(_35) - 13.0f) < 0.0500000007450580596923828125f;
43    }
44    else
45    {
46        _72 = false;
47    }
48    bool _78 = false;
49    if (_72)
50    {
51        _78 = abs(3.0f - 3.0f) < 0.0500000007450580596923828125f;
52    }
53    else
54    {
55        _78 = false;
56    }
57    bool _84 = false;
58    if (_78)
59    {
60        _84 = abs(3.0f - 3.0f) < 0.0500000007450580596923828125f;
61    }
62    else
63    {
64        _84 = false;
65    }
66    bool _90 = false;
67    if (_84)
68    {
69        _90 = abs(5.0f - 5.0f) < 0.0500000007450580596923828125f;
70    }
71    else
72    {
73        _90 = false;
74    }
75    bool _96 = false;
76    if (_90)
77    {
78        _96 = abs(13.0f - 13.0f) < 0.0500000007450580596923828125f;
79    }
80    else
81    {
82        _96 = false;
83    }
84    float4 _97 = 0.0f.xxxx;
85    if (_96)
86    {
87        _97 = _7_colorGreen;
88    }
89    else
90    {
91        _97 = _7_colorRed;
92    }
93    return _97;
94}
95
96void frag_main()
97{
98    float2 _17 = 0.0f.xx;
99    sk_FragColor = main(_17);
100}
101
102SPIRV_Cross_Output main()
103{
104    frag_main();
105    SPIRV_Cross_Output stage_output;
106    stage_output.sk_FragColor = sk_FragColor;
107    return stage_output;
108}
109