gsdx-ogl: Synchronize accurate blending enumeration with gui options.

This commit is contained in:
lightningterror 2020-03-02 18:27:18 +01:00
parent aaaf80f785
commit e860742131
2 changed files with 28 additions and 23 deletions

View File

@ -474,7 +474,7 @@ void GSRendererOGL::EmulateBlending(bool DATE_GL42)
if (m_env.PABE.PABE)
{
GL_INS("!!! ENV PABE not supported !!!");
if (m_sw_blending >= ACC_BLEND_CCLIP_DALPHA) {
if (m_sw_blending >= ACC_BLEND_MEDIUM) {
// m_ps_sel.pabe = 1;
m_require_full_barrier |= (ALPHA.C == 1);
sw_blending = true;
@ -501,22 +501,27 @@ void GSRendererOGL::EmulateBlending(bool DATE_GL42)
// Warning no break on purpose
// Note: the "fall through" comments tell gcc not to complain about not having breaks.
switch (m_sw_blending) {
case ACC_BLEND_ULTRA: sw_blending |= true;
// fall through
case ACC_BLEND_FULL: if (!m_vt.m_alpha.valid && (ALPHA.C == 0)) GetAlphaMinMax();
sw_blending |= (ALPHA.A != ALPHA.B) &&
((ALPHA.C == 0 && m_vt.m_alpha.max > 128) || (ALPHA.C == 2 && ALPHA.FIX > 128u));
// fall through
case ACC_BLEND_CCLIP_DALPHA: sw_blending |= (ALPHA.C == 1);
// Initial idea was to enable accurate blending for sprite rendering to handle
// correctly post-processing effect. Some games (ZoE) use tons of sprites as particles.
// In order to keep it fast, let's limit it to smaller draw call.
// fall through
case ACC_BLEND_SPRITE: sw_blending |= m_vt.m_primclass == GS_SPRITE_CLASS && m_drawlist.size() < 100;
// fall through
case ACC_BLEND_FREE: sw_blending |= impossible_or_free_blend;
// fall through
default: /*sw_blending |= accumulation_blend*/;
case ACC_BLEND_ULTRA:
sw_blending |= true;
// fall through
case ACC_BLEND_FULL:
if (!m_vt.m_alpha.valid && (ALPHA.C == 0)) GetAlphaMinMax();
sw_blending |= (ALPHA.A != ALPHA.B) && ((ALPHA.C == 0 && m_vt.m_alpha.max > 128) || (ALPHA.C == 2 && ALPHA.FIX > 128u));
// fall through
case ACC_BLEND_HIGH:
sw_blending |= (ALPHA.C == 1);
// fall through
case ACC_BLEND_MEDIUM:
// Initial idea was to enable accurate blending for sprite rendering to handle
// correctly post-processing effect. Some games (ZoE) use tons of sprites as particles.
// In order to keep it fast, let's limit it to smaller draw call.
sw_blending |= m_vt.m_primclass == GS_SPRITE_CLASS && m_drawlist.size() < 100;
// fall through
case ACC_BLEND_BASIC:
sw_blending |= impossible_or_free_blend;
// fall through
default:
/*sw_blending |= accumulation_blend*/;
}
// SW Blending
// GL42 interact very badly with sw blending. GL42 uses the primitiveID to find the primitive

View File

@ -40,12 +40,12 @@ class GSRendererOGL final : public GSRendererHW
};
enum ACC_BLEND {
ACC_BLEND_NONE = 0,
ACC_BLEND_FREE = 1,
ACC_BLEND_SPRITE = 2,
ACC_BLEND_CCLIP_DALPHA = 3,
ACC_BLEND_FULL = 4,
ACC_BLEND_ULTRA = 5
ACC_BLEND_NONE = 0,
ACC_BLEND_BASIC = 1,
ACC_BLEND_MEDIUM = 2,
ACC_BLEND_HIGH = 3,
ACC_BLEND_FULL = 4,
ACC_BLEND_ULTRA = 5
};
private: