xref: /aosp_15_r20/external/skia/tests/sksl/shared/TemporaryIndexLookup.hlsl (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1cbuffer _UniformBuffer : register(b0, space0)
2{
3    float4 _8_colorGreen : packoffset(c0);
4    float4 _8_colorRed : packoffset(c1);
5    row_major float3x3 _8_testMatrix3x3 : packoffset(c2);
6};
7
8
9static float4 sk_FragColor;
10
11struct SPIRV_Cross_Output
12{
13    float4 sk_FragColor : SV_Target0;
14};
15
16float3x3 GetTestMatrix_f33()
17{
18    return _8_testMatrix3x3;
19}
20
21float4 main(float2 _31)
22{
23    float expected = 0.0f;
24    for (int i = 0; i < 3; i++)
25    {
26        for (int j = 0; j < 3; j++)
27        {
28            float _55 = expected;
29            float _57 = _55 + 1.0f;
30            expected = _57;
31            float3x3 _58 = GetTestMatrix_f33();
32            if (_58[i][j] != _57)
33            {
34                return _8_colorRed;
35            }
36        }
37    }
38    return _8_colorGreen;
39}
40
41void frag_main()
42{
43    float2 _20 = 0.0f.xx;
44    sk_FragColor = main(_20);
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