xref: /aosp_15_r20/external/skia/tests/sksl/intrinsics/Determinant.hlsl (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1cbuffer _UniformBuffer : register(b0, space0)
2{
3    row_major float2x2 _7_testMatrix2x2 : packoffset(c0);
4    float4 _7_colorGreen : packoffset(c2);
5    float4 _7_colorRed : packoffset(c3);
6};
7
8
9static float4 sk_FragColor;
10
11struct SPIRV_Cross_Output
12{
13    float4 sk_FragColor : SV_Target0;
14};
15
16float4 main(float2 _22)
17{
18    float4 _33 = 0.0f.xxxx;
19    if (determinant(_7_testMatrix2x2) == (-2.0f))
20    {
21        _33 = _7_colorGreen;
22    }
23    else
24    {
25        _33 = _7_colorRed;
26    }
27    return _33;
28}
29
30void frag_main()
31{
32    float2 _18 = 0.0f.xx;
33    sk_FragColor = main(_18);
34}
35
36SPIRV_Cross_Output main()
37{
38    frag_main();
39    SPIRV_Cross_Output stage_output;
40    stage_output.sk_FragColor = sk_FragColor;
41    return stage_output;
42}
43