#pragma clang diagnostic ignored "-Wmissing-prototypes" #include #include using namespace metal; struct SSBO0 { float scalar; float2 vec2_val; float3 vec3_val; float4 vec4_val; }; template struct SpvHalfTypeSelector; template <> struct SpvHalfTypeSelector { public: using H = half; }; template <> struct SpvHalfTypeSelector { public: using H = half2; }; template <> struct SpvHalfTypeSelector { public: using H = half3; }; template <> struct SpvHalfTypeSelector { public: using H = half4; }; template::H> [[clang::optnone]] F spvQuantizeToF16(F val) { return F(H(val)); } kernel void main0(device SSBO0& _4 [[buffer(0)]]) { _4.scalar = spvQuantizeToF16(_4.scalar); _4.vec2_val = spvQuantizeToF16(_4.vec2_val); _4.vec3_val = spvQuantizeToF16(_4.vec3_val); _4.vec4_val = spvQuantizeToF16(_4.vec4_val); }