#include <metal_stdlib>

using namespace metal;
void textureStore_e72bdc(texture2d_array<float, access::read_write> tint_symbol) {
  tint_symbol.write(float4(1.0f), uint2(int2(1)), 1u); tint_symbol.fence();
}

fragment void fragment_main(texture2d_array<float, access::read_write> tint_symbol_1 [[texture(0)]]) {
  textureStore_e72bdc(tint_symbol_1);
  return;
}

kernel void compute_main(texture2d_array<float, access::read_write> tint_symbol_2 [[texture(0)]]) {
  textureStore_e72bdc(tint_symbol_2);
  return;
}

