1struct S { 2 float y; 3}; 4 5// Unsized array parameters only work with readonly buffers. 6layout(set = 0, binding = 0) readonly buffer testStorageBuffer { 7 float[] testArr; 8}; 9layout(set = 0, binding = 1) readonly buffer testStorageBufferStruct { 10 S[] testArrStruct; 11}; 12 13noinline float unsizedInParameterA(float x[]) { return x[0]; } 14noinline float unsizedInParameterB(S x[]) { return x[0].y; } 15noinline float unsizedInParameterC(float[] x) { return x[0]; } 16noinline float unsizedInParameterD(S[] x) { return x[0].y; } 17noinline float unsizedInParameterE(float[]) { return 0.0; } 18noinline float unsizedInParameterF(S[]) { return 0.0; } 19 20noinline half4 getColor(float[] arr) { 21 return half4(arr[0], arr[1], arr[2], arr[3]); 22} 23 24noinline half4 getColor_helper(float[] arr) { 25 return getColor(arr); 26} 27 28void main() { 29 sk_FragColor = getColor_helper(testArr); 30 31 unsizedInParameterA(testArr); 32 unsizedInParameterB(testArrStruct); 33 unsizedInParameterC(testArr); 34 unsizedInParameterD(testArrStruct); 35 unsizedInParameterE(testArr); 36 unsizedInParameterF(testArrStruct); 37} 38