#include <metal_stdlib>

using namespace metal;
float4 textureSampleBias_80e579(texture2d_array<float, access::sample> tint_symbol, sampler tint_symbol_1) {
  float4 res = tint_symbol.sample(tint_symbol_1, float2(1.0f), max(0, 1), bias(1.0f));
  return res;
}

fragment void fragment_main(device float4* tint_symbol_2 [[buffer(0)]], texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]], sampler tint_symbol_4 [[sampler(0)]]) {
  *(tint_symbol_2) = textureSampleBias_80e579(tint_symbol_3, tint_symbol_4);
  return;
}

