#include <metal_stdlib>
using namespace metal;

struct FragmentIn {
  float4 position [[position]];
  float2 uv;
  float4 color;
};

fragment float4 fragment_main(
  FragmentIn in [[stage_in]],
  texture2d<float> tex [[texture(0)]],
  sampler samp [[sampler(0)]]
) {
  float4 tex_color = tex.sample(samp, in.uv);
  return tex_color * in.color;
}
