#include <metal_stdlib>
using namespace metal;

struct tint_module_vars_struct {
  device float2* prevent_dce;
};

float2 fwidthFine_ff6aa0() {
  float2 const v = dfdx(float2(1.0f));
  float2 res = (abs(v) + abs(dfdy(float2(1.0f))));
  return res;
}

fragment void fragment_main(device float2* prevent_dce [[buffer(0)]]) {
  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.prevent_dce=prevent_dce};
  (*tint_module_vars.prevent_dce) = fwidthFine_ff6aa0();
}
