xref: /aosp_15_r20/external/skia/resources/sksl/errors/MatrixInlinedIndexOutOfRange.sksl (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1uniform half4 colorGreen, colorRed;
2
3const float3x3 values = float3x3(1);
4
5inline float3 indexMatrix(int index) {
6    return values[index];
7}
8
9half4 main(float2 coords) {
10    float3 ok = indexMatrix(0) + indexMatrix(1) + indexMatrix(2);
11    float3 undefined = indexMatrix(-1) + indexMatrix(3);
12    return colorGreen;
13}
14
15/*%%*
16index -1 out of range for 'float3x3'
17index 3 out of range for 'float3x3'
18*%%*/
19