GS: Update interlacing on Metal

This commit is contained in:
refractionpcsx2 2022-05-20 17:17:52 +01:00
parent 89d44a5f60
commit 0c855cdd6d
3 changed files with 2 additions and 4 deletions

View File

@ -500,7 +500,6 @@ void GSDeviceMTL::DoInterlace(GSTexture* sTex, GSTexture* dTex, int shader, bool
GSMTLInterlacePSUniform cb = {};
cb.ZrH = {0, 1.f / s.y};
cb.hH = s.y / 2;
DoStretchRect(sTex, sRect, dTex, dRect, m_interlace_pipeline[shader], linear, shader > 1 ? LoadAction::DontCareIfFull : LoadAction::Load, &cb, sizeof(cb));
}}

View File

@ -42,7 +42,6 @@ struct GSMTLConvertPSUniform
struct GSMTLInterlacePSUniform
{
vector_float2 ZrH;
float hH;
};
struct GSMTLMainVSUniform

View File

@ -20,7 +20,7 @@ using namespace metal;
fragment float4 ps_interlace0(ConvertShaderData data [[stage_in]], ConvertPSRes res,
constant GSMTLInterlacePSUniform& uniform [[buffer(GSMTLBufferIndexUniforms)]])
{
if (fract(data.t.y * uniform.hH) - 0.5f < 0.f)
if ((int(data.p.y) & 1) == 0)
discard_fragment();
return res.sample(data.t);
}
@ -28,7 +28,7 @@ fragment float4 ps_interlace0(ConvertShaderData data [[stage_in]], ConvertPSRes
fragment float4 ps_interlace1(ConvertShaderData data [[stage_in]], ConvertPSRes res,
constant GSMTLInterlacePSUniform& uniform [[buffer(GSMTLBufferIndexUniforms)]])
{
if (0.5f - fract(data.t.y * uniform.hH) < 0.f)
if ((int(data.p.y) & 1) != 0)
discard_fragment();
return res.sample(data.t);
}