mirror of https://github.com/PCSX2/pcsx2.git
GS/HW: Wip Zero blend RT.
This commit is contained in:
parent
2b7c4ae438
commit
71b6d40d08
|
@ -4098,6 +4098,18 @@ void GSRendererHW::EmulateBlending(int rt_alpha_min, int rt_alpha_max, const boo
|
||||||
GL_INS("Draw AlphaMinMax: %d-%d, RT AlphaMinMax: %d-%d, AFIX: %u", GetAlphaMinMax().min, GetAlphaMinMax().max, rt_alpha_min, rt_alpha_max, AFIX);
|
GL_INS("Draw AlphaMinMax: %d-%d, RT AlphaMinMax: %d-%d, AFIX: %u", GetAlphaMinMax().min, GetAlphaMinMax().max, rt_alpha_min, rt_alpha_max, AFIX);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (rt->m_dirty.empty() && rt->m_rt_rgb_zero)
|
||||||
|
{
|
||||||
|
if (m_conf.ps.blend_a == 1)
|
||||||
|
m_conf.ps.blend_a = 2;
|
||||||
|
if (m_conf.ps.blend_b == 1)
|
||||||
|
m_conf.ps.blend_b = 2;
|
||||||
|
if (m_conf.ps.blend_d == 1)
|
||||||
|
m_conf.ps.blend_d = 2;
|
||||||
|
|
||||||
|
rt->m_rt_rgb_zero = false;
|
||||||
|
}
|
||||||
|
|
||||||
// If the colour is modulated to zero or we're not using a texture and the color is zero, we can replace any Cs with 0
|
// If the colour is modulated to zero or we're not using a texture and the color is zero, we can replace any Cs with 0
|
||||||
if ((!PRIM->TME || m_cached_ctx.TEX0.TFX != TFX_DECAL) && (!PRIM->FGE || m_draw_env->FOGCOL.U32[0] == 0) &&
|
if ((!PRIM->TME || m_cached_ctx.TEX0.TFX != TFX_DECAL) && (!PRIM->FGE || m_draw_env->FOGCOL.U32[0] == 0) &&
|
||||||
((m_vt.m_max.c == GSVector4i::zero()).mask() & 0xfff) == 0xfff)
|
((m_vt.m_max.c == GSVector4i::zero()).mask() & 0xfff) == 0xfff)
|
||||||
|
@ -4201,6 +4213,11 @@ void GSRendererHW::EmulateBlending(int rt_alpha_min, int rt_alpha_max, const boo
|
||||||
m_conf.ps.blend_d = 2;
|
m_conf.ps.blend_d = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (rt->m_dirty.empty() && (m_conf.ps.blend_a == m_conf.ps.blend_b) && m_conf.ps.blend_d == 2)
|
||||||
|
{
|
||||||
|
rt->m_rt_rgb_zero = true;
|
||||||
|
}
|
||||||
|
|
||||||
// Ad cases, alpha write is masked, one barrier is enough, for d3d11 read the fb
|
// Ad cases, alpha write is masked, one barrier is enough, for d3d11 read the fb
|
||||||
// Replace Ad with As, blend flags will be used from As since we are chaging the blend_index value.
|
// Replace Ad with As, blend flags will be used from As since we are chaging the blend_index value.
|
||||||
// Must be done before index calculation, after blending equation optimizations
|
// Must be done before index calculation, after blending equation optimizations
|
||||||
|
|
|
@ -220,6 +220,7 @@ public:
|
||||||
bool m_valid_alpha_high = false;
|
bool m_valid_alpha_high = false;
|
||||||
bool m_valid_rgb = false;
|
bool m_valid_rgb = false;
|
||||||
bool m_rt_alpha_scale = false;
|
bool m_rt_alpha_scale = false;
|
||||||
|
bool m_rt_rgb_zero = false;
|
||||||
bool m_downscaled = false;
|
bool m_downscaled = false;
|
||||||
int m_last_draw = 0;
|
int m_last_draw = 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue