1struct StructB { 2 float val; 3}; 4 5struct StructA { 6 StructB structB; 7 float val; 8}; 9 10layout(set = 0, binding = 0) readonly buffer testStorageBuffer { 11 StructA testStructA; 12 float[] testArr; 13}; 14layout(set = 0, binding = 1) readonly buffer testSecondStorageBuffer { 15 StructA[] testStructArr; 16}; 17 18noinline float foo(float[] arr, float f) { 19 return arr[int(f)]; 20} 21 22noinline float bar(StructA[] arr, float f) { 23 return arr[int(f)].structB.val; 24} 25 26void main() { 27 foo(testArr, testStructA.val); 28 foo(testArr, testStructA.structB.val); 29 bar(testStructArr, testStructA.structB.val); 30} 31