#include <metal_stdlib>

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

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

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

