
RWByteAddressBuffer s : register(u0);
float f1(float a[4]) {
  return a[int(3)];
}

float f2(float a[3][4]) {
  return a[int(2)][int(3)];
}

float f3(float a[2][3][4]) {
  return a[int(1)][int(2)][int(3)];
}

[numthreads(1, 1, 1)]
void main() {
  float v[4] = (float[4])0;
  float v_1[3][4] = (float[3][4])0;
  float v_2[2][3][4] = (float[2][3][4])0;
  float a1[4] = v;
  float v1 = f1(a1);
  float a2[3][4] = v_1;
  float v2 = f2(a2);
  float a3[2][3][4] = v_2;
  float v3 = f3(a3);
  s.Store(0u, asuint(((v1 + v2) + v3)));
}

