mirror of https://github.com/PCSX2/pcsx2.git
GS-hw: Move PABE shader bit to the top of sw blending.
Early return when there is no sw blending, no need to run the blend code. Optimization.
This commit is contained in:
parent
cf2b6a895f
commit
3c92054a6e
|
@ -727,6 +727,14 @@ void ps_blend(inout float4 Color, float As, float2 pos_xy)
|
|||
{
|
||||
if (SW_BLEND)
|
||||
{
|
||||
// PABE
|
||||
if (PS_PABE)
|
||||
{
|
||||
// No blending so early exit
|
||||
if (As < 1.0f)
|
||||
return;
|
||||
}
|
||||
|
||||
float4 RT = trunc(RtSampler.Load(int3(pos_xy, 0)) * 255.0f + 0.1f);
|
||||
|
||||
float Ad = (PS_DFMT == FMT_24) ? 1.0f : RT.a / 128.0f;
|
||||
|
@ -744,10 +752,6 @@ void ps_blend(inout float4 Color, float As, float2 pos_xy)
|
|||
C = min(C, (float)1.0f);
|
||||
|
||||
Color.rgb = (PS_BLEND_A == PS_BLEND_B) ? D : trunc(((A - B) * C) + D);
|
||||
|
||||
// PABE
|
||||
if (PS_PABE)
|
||||
Color.rgb = (As >= 1.0f) ? Color.rgb : Cs;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -656,6 +656,14 @@ void ps_color_clamp_wrap(inout vec3 C)
|
|||
void ps_blend(inout vec4 Color, float As)
|
||||
{
|
||||
#if SW_BLEND
|
||||
|
||||
// PABE
|
||||
#if PS_PABE
|
||||
// No blending so early exit
|
||||
if (As < 1.0f)
|
||||
return;
|
||||
#endif
|
||||
|
||||
vec4 RT = trunc(texelFetch(RtSampler, ivec2(gl_FragCoord.xy), 0) * 255.0f + 0.1f);
|
||||
|
||||
#if PS_DFMT == FMT_24
|
||||
|
@ -713,11 +721,6 @@ void ps_blend(inout vec4 Color, float As)
|
|||
Color.rgb = trunc((A - B) * C + D);
|
||||
#endif
|
||||
|
||||
// PABE
|
||||
#if PS_PABE
|
||||
Color.rgb = (As >= 1.0f) ? Color.rgb : Cs;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -989,11 +989,19 @@ void ps_color_clamp_wrap(inout vec3 C)
|
|||
void ps_blend(inout vec4 Color, float As)
|
||||
{
|
||||
#if SW_BLEND
|
||||
|
||||
// PABE
|
||||
#if PS_PABE
|
||||
// No blending so early exit
|
||||
if (As < 1.0f)
|
||||
return;
|
||||
#endif
|
||||
|
||||
#if PS_FEEDBACK_LOOP_IS_NEEDED
|
||||
vec4 RT = trunc(subpassLoad(RtSampler) * 255.0f + 0.1f);
|
||||
vec4 RT = trunc(subpassLoad(RtSampler) * 255.0f + 0.1f);
|
||||
#else
|
||||
// Not used, but we define it to make the selection below simpler.
|
||||
vec4 RT = vec4(0.0f);
|
||||
// Not used, but we define it to make the selection below simpler.
|
||||
vec4 RT = vec4(0.0f);
|
||||
#endif
|
||||
|
||||
#if PS_DFMT == FMT_24
|
||||
|
@ -1051,11 +1059,6 @@ void ps_blend(inout vec4 Color, float As)
|
|||
Color.rgb = trunc((A - B) * C + D);
|
||||
#endif
|
||||
|
||||
// PABE
|
||||
#if PS_PABE
|
||||
Color.rgb = (As >= 1.0f) ? Color.rgb : Cs;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue