xref: /aosp_15_r20/external/skia/tests/sksl/intrinsics/Cross.hlsl (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1cbuffer _UniformBuffer : register(b0, space0)
2{
3    row_major float3x3 _7_testMatrix3x3 : packoffset(c0);
4    float4 _7_colorGreen : packoffset(c3);
5    float4 _7_colorRed : packoffset(c4);
6};
7
8
9static float4 sk_FragColor;
10
11struct SPIRV_Cross_Output
12{
13    float4 sk_FragColor : SV_Target0;
14};
15
16float4 main(float2 _23)
17{
18    float3 _27 = cross(_7_testMatrix3x3[0], _7_testMatrix3x3[1]);
19    bool _59 = false;
20    if (all(bool3(_27.x == float3(-3.0f, 6.0f, -3.0f).x, _27.y == float3(-3.0f, 6.0f, -3.0f).y, _27.z == float3(-3.0f, 6.0f, -3.0f).z)))
21    {
22        float3 _47 = cross(_7_testMatrix3x3[2], _7_testMatrix3x3[0]);
23        _59 = all(bool3(_47.x == float3(6.0f, -12.0f, 6.0f).x, _47.y == float3(6.0f, -12.0f, 6.0f).y, _47.z == float3(6.0f, -12.0f, 6.0f).z));
24    }
25    else
26    {
27        _59 = false;
28    }
29    float4 _60 = 0.0f.xxxx;
30    if (_59)
31    {
32        _60 = _7_colorGreen;
33    }
34    else
35    {
36        _60 = _7_colorRed;
37    }
38    return _60;
39}
40
41void frag_main()
42{
43    float2 _19 = 0.0f.xx;
44    sk_FragColor = main(_19);
45}
46
47SPIRV_Cross_Output main()
48{
49    frag_main();
50    SPIRV_Cross_Output stage_output;
51    stage_output.sk_FragColor = sk_FragColor;
52    return stage_output;
53}
54