xref: /aosp_15_r20/external/skia/tests/sksl/shared/ConstantCompositeAccessViaConstantIndex.hlsl (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1cbuffer _UniformBuffer : register(b0, space0)
2{
3    float4 _20_colorRed : packoffset(c0);
4    row_major float2x2 _20_testMatrix2x2 : packoffset(c1);
5    float _20_testArray[5] : packoffset(c3);
6};
7
8
9static float4 sk_FragColor;
10
11struct SPIRV_Cross_Output
12{
13    float4 sk_FragColor : SV_Target0;
14};
15
16static float globalArray[5] = { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f };
17static float2x2 globalMatrix = float2x2(0.0f.xx, 0.0f.xx);
18
19float4 main(float2 _33)
20{
21    float _13[5] = { 1.0f, 1.0f, 1.0f, 1.0f, 1.0f };
22    globalArray = _13;
23    globalMatrix = float2x2(1.0f.xx, 1.0f.xx);
24    float _40[5] = { 0.0f, 1.0f, 2.0f, 3.0f, 4.0f };
25    float localArray[5] = _40;
26    float2x2 localMatrix = float2x2(float2(0.0f, 1.0f), float2(2.0f, 3.0f));
27    bool _76 = false;
28    if ((1.0f == _20_testArray[4]) && ((1.0f == _20_testArray[3]) && ((1.0f == _20_testArray[2]) && ((1.0f == _20_testArray[1]) && (1.0f == _20_testArray[0])))))
29    {
30        _76 = true;
31    }
32    else
33    {
34        _76 = all(bool2(1.0f.xx.x == _20_colorRed.xy.x, 1.0f.xx.y == _20_colorRed.xy.y));
35    }
36    bool _90 = false;
37    if (_76)
38    {
39        _90 = true;
40    }
41    else
42    {
43        _90 = all(bool2(1.0f.xx.x == _20_testMatrix2x2[0].x, 1.0f.xx.y == _20_testMatrix2x2[0].y)) && all(bool2(1.0f.xx.x == _20_testMatrix2x2[1].x, 1.0f.xx.y == _20_testMatrix2x2[1].y));
44    }
45    bool _109 = false;
46    if (_90)
47    {
48        _109 = true;
49    }
50    else
51    {
52        _109 = (4.0f == _20_testArray[4]) && ((3.0f == _20_testArray[3]) && ((2.0f == _20_testArray[2]) && ((1.0f == _20_testArray[1]) && (0.0f == _20_testArray[0]))));
53    }
54    bool _117 = false;
55    if (_109)
56    {
57        _117 = true;
58    }
59    else
60    {
61        _117 = all(bool2(1.0f.xx.x == _20_colorRed.xy.x, 1.0f.xx.y == _20_colorRed.xy.y));
62    }
63    bool _129 = false;
64    if (_117)
65    {
66        _129 = true;
67    }
68    else
69    {
70        _129 = all(bool2(float2(0.0f, 1.0f).x == _20_testMatrix2x2[0].x, float2(0.0f, 1.0f).y == _20_testMatrix2x2[0].y)) && all(bool2(float2(2.0f, 3.0f).x == _20_testMatrix2x2[1].x, float2(2.0f, 3.0f).y == _20_testMatrix2x2[1].y));
71    }
72    if (_129)
73    {
74        return _20_colorRed;
75    }
76    return float4(0.0f, 1.0f, 0.0f, 1.0f);
77}
78
79void frag_main()
80{
81    float2 _29 = 0.0f.xx;
82    float4 _31 = main(_29);
83    sk_FragColor = _31;
84}
85
86SPIRV_Cross_Output main()
87{
88    frag_main();
89    SPIRV_Cross_Output stage_output;
90    stage_output.sk_FragColor = sk_FragColor;
91    return stage_output;
92}
93