#include <metal_stdlib>

using namespace metal;
void textureStore_4288fc(texture3d<float, access::write> tint_symbol) {
  tint_symbol.write(float4(1.0f), uint3(uint3(1u)));
}

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

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

