#include <metal_stdlib>

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

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

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

