mirror of https://github.com/PCSX2/pcsx2.git
GS/HW: Make sure we don't multiply Cs if Ad is corrected.
Another potential to avoid copies.
This commit is contained in:
parent
71376ff4e6
commit
58628b8dd3
|
@ -930,7 +930,7 @@ void ps_blend(inout float4 Color, inout float4 As_rgba, float2 pos_xy)
|
||||||
Color.rgb = max((float3)0.0f, (Alpha - (float3)1.0f));
|
Color.rgb = max((float3)0.0f, (Alpha - (float3)1.0f));
|
||||||
Color.rgb *= (float3)255.0f;
|
Color.rgb *= (float3)255.0f;
|
||||||
}
|
}
|
||||||
else if (PS_BLEND_HW == 3)
|
else if (PS_BLEND_HW == 3 && PS_RTA_CORRECTION == 0)
|
||||||
{
|
{
|
||||||
// Needed for Cs*Ad, Cs*Ad + Cd, Cd - Cs*Ad
|
// Needed for Cs*Ad, Cs*Ad + Cd, Cd - Cs*Ad
|
||||||
// Multiply Color.rgb by (255/128) to compensate for wrong Ad/255 value when rgb are below 128.
|
// Multiply Color.rgb by (255/128) to compensate for wrong Ad/255 value when rgb are below 128.
|
||||||
|
|
|
@ -910,7 +910,7 @@ float As = As_rgba.a;
|
||||||
|
|
||||||
Color.rgb = max(vec3(0.0f), (Alpha - vec3(1.0f)));
|
Color.rgb = max(vec3(0.0f), (Alpha - vec3(1.0f)));
|
||||||
Color.rgb *= vec3(255.0f);
|
Color.rgb *= vec3(255.0f);
|
||||||
#elif PS_BLEND_HW == 3
|
#elif PS_BLEND_HW == 3 && PS_RTA_CORRECTION == 0
|
||||||
// Needed for Cs*Ad, Cs*Ad + Cd, Cd - Cs*Ad
|
// Needed for Cs*Ad, Cs*Ad + Cd, Cd - Cs*Ad
|
||||||
// Multiply Color.rgb by (255/128) to compensate for wrong Ad/255 value when rgb are below 128.
|
// Multiply Color.rgb by (255/128) to compensate for wrong Ad/255 value when rgb are below 128.
|
||||||
// When any color channel is higher than 128 then adjust the compensation automatically
|
// When any color channel is higher than 128 then adjust the compensation automatically
|
||||||
|
|
|
@ -1163,7 +1163,7 @@ void ps_blend(inout vec4 Color, inout vec4 As_rgba)
|
||||||
|
|
||||||
Color.rgb = max(vec3(0.0f), (Alpha - vec3(1.0f)));
|
Color.rgb = max(vec3(0.0f), (Alpha - vec3(1.0f)));
|
||||||
Color.rgb *= vec3(255.0f);
|
Color.rgb *= vec3(255.0f);
|
||||||
#elif PS_BLEND_HW == 3
|
#elif PS_BLEND_HW == 3 && PS_RTA_CORRECTION == 0
|
||||||
// Needed for Cs*Ad, Cs*Ad + Cd, Cd - Cs*Ad
|
// Needed for Cs*Ad, Cs*Ad + Cd, Cd - Cs*Ad
|
||||||
// Multiply Color.rgb by (255/128) to compensate for wrong Ad/255 value when rgb are below 128.
|
// Multiply Color.rgb by (255/128) to compensate for wrong Ad/255 value when rgb are below 128.
|
||||||
// When any color channel is higher than 128 then adjust the compensation automatically
|
// When any color channel is higher than 128 then adjust the compensation automatically
|
||||||
|
|
|
@ -991,7 +991,7 @@ struct PSMain
|
||||||
float Alpha = PS_BLEND_C == 2 ? cb.alpha_fix : As;
|
float Alpha = PS_BLEND_C == 2 ? cb.alpha_fix : As;
|
||||||
Color.rgb = saturate(Alpha - 1.f) * 255.f;
|
Color.rgb = saturate(Alpha - 1.f) * 255.f;
|
||||||
}
|
}
|
||||||
else if (PS_BLEND_HW == 3)
|
else if (PS_BLEND_HW == 3 && PS_RTA_CORRECTION == 0)
|
||||||
{
|
{
|
||||||
// Needed for Cs*Ad, Cs*Ad + Cd, Cd - Cs*Ad
|
// Needed for Cs*Ad, Cs*Ad + Cd, Cd - Cs*Ad
|
||||||
// Multiply Color.rgb by (255/128) to compensate for wrong Ad/255 value when rgb are below 128.
|
// Multiply Color.rgb by (255/128) to compensate for wrong Ad/255 value when rgb are below 128.
|
||||||
|
|
Loading…
Reference in New Issue