xref: /aosp_15_r20/external/skia/tests/sksl/shared/MatrixToVectorCast.hlsl (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1cbuffer _UniformBuffer : register(b0, space0)
2{
3    float4 _7_colorGreen : packoffset(c0);
4    float4 _7_colorRed : packoffset(c1);
5    row_major float2x2 _7_testMatrix2x2 : 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 _22)
17{
18    bool ok = true;
19    bool _49 = false;
20    if (true)
21    {
22        float4 _40 = float4(_7_testMatrix2x2[0].x, _7_testMatrix2x2[0].y, _7_testMatrix2x2[1].x, _7_testMatrix2x2[1].y);
23        _49 = all(bool4(_40.x == float4(1.0f, 2.0f, 3.0f, 4.0f).x, _40.y == float4(1.0f, 2.0f, 3.0f, 4.0f).y, _40.z == float4(1.0f, 2.0f, 3.0f, 4.0f).z, _40.w == float4(1.0f, 2.0f, 3.0f, 4.0f).w));
24    }
25    else
26    {
27        _49 = false;
28    }
29    ok = _49;
30    bool _61 = false;
31    if (_49)
32    {
33        float4 _58 = float4(_7_testMatrix2x2[0].x, _7_testMatrix2x2[0].y, _7_testMatrix2x2[1].x, _7_testMatrix2x2[1].y);
34        _61 = all(bool4(_58.x == float4(1.0f, 2.0f, 3.0f, 4.0f).x, _58.y == float4(1.0f, 2.0f, 3.0f, 4.0f).y, _58.z == float4(1.0f, 2.0f, 3.0f, 4.0f).z, _58.w == float4(1.0f, 2.0f, 3.0f, 4.0f).w));
35    }
36    else
37    {
38        _61 = false;
39    }
40    ok = _61;
41    bool _83 = false;
42    if (_61)
43    {
44        int4 _76 = int4(int(_7_testMatrix2x2[0].x), int(_7_testMatrix2x2[0].y), int(_7_testMatrix2x2[1].x), int(_7_testMatrix2x2[1].y));
45        _83 = all(bool4(_76.x == int4(1, 2, 3, 4).x, _76.y == int4(1, 2, 3, 4).y, _76.z == int4(1, 2, 3, 4).z, _76.w == int4(1, 2, 3, 4).w));
46    }
47    else
48    {
49        _83 = false;
50    }
51    ok = _83;
52    bool _101 = false;
53    if (_83)
54    {
55        bool4 _97 = bool4(_7_testMatrix2x2[0].x != 0.0f, _7_testMatrix2x2[0].y != 0.0f, _7_testMatrix2x2[1].x != 0.0f, _7_testMatrix2x2[1].y != 0.0f);
56        _101 = all(bool4(_97.x == bool4(true, true, true, true).x, _97.y == bool4(true, true, true, true).y, _97.z == bool4(true, true, true, true).z, _97.w == bool4(true, true, true, true).w));
57    }
58    else
59    {
60        _101 = false;
61    }
62    ok = _101;
63    float4 _102 = 0.0f.xxxx;
64    if (_101)
65    {
66        _102 = _7_colorGreen;
67    }
68    else
69    {
70        _102 = _7_colorRed;
71    }
72    return _102;
73}
74
75void frag_main()
76{
77    float2 _18 = 0.0f.xx;
78    sk_FragColor = main(_18);
79}
80
81SPIRV_Cross_Output main()
82{
83    frag_main();
84    SPIRV_Cross_Output stage_output;
85    stage_output.sk_FragColor = sk_FragColor;
86    return stage_output;
87}
88