xref: /aosp_15_r20/external/skia/tests/sksl/shared/ArrayUnsizedParam.glsl (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1
2out vec4 sk_FragColor;
3struct S {
4    float y;
5};
6layout (binding = 0, set = 0) readonly buffer testStorageBuffer {
7    float[] testArr;
8};
9layout (binding = 1, set = 0) readonly buffer testStorageBufferStruct {
10    S[] testArrStruct;
11};
12float unsizedInParameterA_ff(float x[]) {
13    return x[0];
14}
15float unsizedInParameterB_fS(S x[]) {
16    return x[0].y;
17}
18float unsizedInParameterC_ff(float x[]) {
19    return x[0];
20}
21float unsizedInParameterD_fS(S x[]) {
22    return x[0].y;
23}
24float unsizedInParameterE_ff(float _skAnonymousParam0[]) {
25    return 0.0;
26}
27float unsizedInParameterF_fS(S _skAnonymousParam0[]) {
28    return 0.0;
29}
30vec4 getColor_h4f(float arr[]) {
31    return vec4(arr[0], arr[1], arr[2], arr[3]);
32}
33vec4 getColor_helper_h4f(float arr[]) {
34    return getColor_h4f(arr);
35}
36void main() {
37    sk_FragColor = getColor_helper_h4f(testArr);
38    unsizedInParameterA_ff(testArr);
39    unsizedInParameterB_fS(testArrStruct);
40    unsizedInParameterC_ff(testArr);
41    unsizedInParameterD_fS(testArrStruct);
42    unsizedInParameterE_ff(testArr);
43    unsizedInParameterF_fS(testArrStruct);
44}
45