Skip to content

Commit

Permalink
GS:MTL: RTA correction shader is used to scale textures
Browse files Browse the repository at this point in the history
Can't use a DirectReadTextureIn, which reads from the pixel with the same location
  • Loading branch information
TellowKrinkle authored and refractionpcsx2 committed Mar 26, 2024
1 parent 68a71d2 commit e9ac262
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pcsx2/GS/Renderers/Metal/convert.metal
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,15 @@ fragment float4 ps_primid_rta_init_datm0(float4 p [[position]], DirectReadTextur
return tex.read(p).a > (254.5f / 255.f) ? -1 : FLT_MAX;
}

fragment float4 ps_rta_correction(float4 p [[position]], DirectReadTextureIn<float> tex)
fragment float4 ps_rta_correction(ConvertShaderData data [[stage_in]], ConvertPSRes res)
{
float4 in = tex.read(p);
float4 in = res.sample(data.t);
return float4(in.rgb, in.a / (127.5f / 255.0f));
}

fragment float4 ps_rta_decorrection(float4 p [[position]], DirectReadTextureIn<float> tex)
fragment float4 ps_rta_decorrection(ConvertShaderData data [[stage_in]], ConvertPSRes res)
{
float4 in = tex.read(p);
float4 in = res.sample(data.t);
return float4(in.rgb, in.a * (128.25f / 255.0f));
}

Expand Down

0 comments on commit e9ac262

Please sign in to comment.