you need to used a "constant" address space, not a "device"
fragment float4 MyFunction(
RasterizerData in [[ stage_in ]],
constant MyParams& params [[ buffer (0) ]],
texture2dhalf, access::sample src [[ texture(0) ]]
)