Skip to content

Commit

Permalink
GS/HW: Adjust RTA shader precision.
Browse files Browse the repository at this point in the history
  • Loading branch information
lightningterror committed Mar 2, 2024
1 parent 4c9c066 commit 7fb558c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions bin/resources/shaders/dx11/convert.fx
Original file line number Diff line number Diff line change
Expand Up @@ -139,15 +139,15 @@ PS_OUTPUT ps_rta_correction(PS_INPUT input)
{
PS_OUTPUT output;
float4 value = sample_c(input.t);
output.c = float4(value.rgb, (value.a * 255.0f) / 127.5f);
output.c = float4(value.rgb, (value.a * 255.0f + 0.1f) / 127.5f);
return output;
}

PS_OUTPUT ps_rta_decorrection(PS_INPUT input)
{
PS_OUTPUT output;
float4 value = sample_c(input.t);
output.c = float4(value.rgb, (value.a * 127.5f) / 255.0f);
output.c = float4(value.rgb, (value.a * 127.5f + 0.1f) / 255.0f);
return output;
}

Expand Down
4 changes: 2 additions & 2 deletions bin/resources/shaders/opengl/convert.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -337,15 +337,15 @@ void ps_datm0_rta_correction()
void ps_rta_correction()
{
vec4 value = sample_c();
SV_Target0 = vec4(value.rgb, (value.a * 255.0f) / 127.5f);
SV_Target0 = vec4(value.rgb, (value.a * 255.0f + 0.1f) / 127.5f);
}
#endif

#ifdef ps_rta_decorrection
void ps_rta_decorrection()
{
vec4 value = sample_c();
SV_Target0 = vec4(value.rgb, (value.a * 127.5f) / 255.0f);
SV_Target0 = vec4(value.rgb, (value.a * 127.5f + 0.1f) / 255.0f);
}
#endif

Expand Down
4 changes: 2 additions & 2 deletions bin/resources/shaders/vulkan/convert.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,15 @@ void ps_datm0_rta_correction()
void ps_rta_correction()
{
vec4 value = sample_c(v_tex);
o_col0 = vec4(value.rgb, (value.a * 255.0f) / 127.5f);
o_col0 = vec4(value.rgb, (value.a * 255.0f + 0.1f) / 127.5f);
}
#endif

#ifdef ps_rta_decorrection
void ps_rta_decorrection()
{
vec4 value = sample_c(v_tex);
o_col0 = vec4(value.rgb, (value.a * 127.5f) / 255.0f);
o_col0 = vec4(value.rgb, (value.a * 127.5f + 0.1f) / 255.0f);
}
#endif

Expand Down
4 changes: 2 additions & 2 deletions pcsx2/GS/Renderers/Metal/convert.metal
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,13 @@ fragment float4 ps_primid_rta_init_datm0(float4 p [[position]], DirectReadTextur
fragment float4 ps_rta_correction(float4 p [[position]], DirectReadTextureIn<float> tex)
{
float4 in = tex.read(p);
return float4(in.rgb, (in.a * 255.f) / 127.5f);
return float4(in.rgb, (in.a * 255.f + 0.1f) / 127.5f);
}

fragment float4 ps_rta_decorrection(float4 p [[position]], DirectReadTextureIn<float> tex)
{
float4 in = tex.read(p);
return float4(in.rgb, (in.a * 127.5f) / 255.f);
return float4(in.rgb, (in.a * 127.5f + 0.1f) / 255.f);
}

fragment float4 ps_hdr_init(float4 p [[position]], DirectReadTextureIn<float> tex)
Expand Down

0 comments on commit 7fb558c

Please sign in to comment.