#include <metal_stdlib>
using namespace metal;

struct tint_module_vars_struct {
  texture2d_array<float, access::write> arg_0;
};

void textureStore_330b7c(tint_module_vars_struct tint_module_vars) {
  tint_module_vars.arg_0.write(float4(1.0f), uint2(1u), 1u);
}

fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
  textureStore_330b7c(tint_module_vars);
}

kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]]) {
  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
  textureStore_330b7c(tint_module_vars);
}
