#include <metal_stdlib>

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

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

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

