#include <metal_stdlib>

using namespace metal;
uint textureNumLayers_0856ae(texture2d_array<float, access::read_write> tint_symbol) {
  uint res = tint_symbol.get_array_size();
  return res;
}

fragment void fragment_main(device uint* tint_symbol_1 [[buffer(0)]], texture2d_array<float, access::read_write> tint_symbol_2 [[texture(0)]]) {
  *(tint_symbol_1) = textureNumLayers_0856ae(tint_symbol_2);
  return;
}

kernel void compute_main(device uint* tint_symbol_3 [[buffer(0)]], texture2d_array<float, access::read_write> tint_symbol_4 [[texture(0)]]) {
  *(tint_symbol_3) = textureNumLayers_0856ae(tint_symbol_4);
  return;
}

