gsdx-ogl: only enable fast accurate colclip in level3

Until we drop the old method
This commit is contained in:
Gregory Hainaut 2015-07-25 16:10:36 +02:00
parent 83dfc6b633
commit 8f27a5a92b
1 changed files with 10 additions and 3 deletions

View File

@ -464,11 +464,12 @@ void GSRendererOGL::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sour
// Blend // Blend
const GIFRegALPHA& ALPHA = context->ALPHA;
float afix = (float)context->ALPHA.FIX / 0x80; float afix = (float)context->ALPHA.FIX / 0x80;
if (!IsOpaque() && rt) if (!IsOpaque() && rt)
{ {
const GIFRegALPHA& ALPHA = context->ALPHA;
om_bsel.abe = PRIM->ABE || PRIM->AA1 && m_vt.m_primclass == GS_LINE_CLASS; om_bsel.abe = PRIM->ABE || PRIM->AA1 && m_vt.m_primclass == GS_LINE_CLASS;
om_bsel.a = ALPHA.A; om_bsel.a = ALPHA.A;
@ -504,8 +505,7 @@ void GSRendererOGL::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sour
// We really need SW blending for this one, barely used // We really need SW blending for this one, barely used
bool impossible_blend = (blend_flag & A_MAX); bool impossible_blend = (blend_flag & A_MAX);
// Do the multiplication in shader for blending accumulation: Cs*As + Cd or Cs*Af + Cd // Do the multiplication in shader for blending accumulation: Cs*As + Cd or Cs*Af + Cd
ps_sel.blend_accu = m_sw_blending && ALPHA.A == 0 && ALPHA.B == 2 && ALPHA.C != 1 && ALPHA.D == 1; bool accumulation_blend = (ALPHA.A == 0 && ALPHA.B == 2 && ALPHA.C != 1 && ALPHA.D == 1);
om_bsel.accu = ps_sel.blend_accu;
bool sw_blending_base = m_sw_blending && (free_blend || impossible_blend || ps_sel.blend_accu); bool sw_blending_base = m_sw_blending && (free_blend || impossible_blend || ps_sel.blend_accu);
@ -519,10 +519,17 @@ void GSRendererOGL::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sour
} else if (!PRIM->TME && PRIM->PRIM != GS_POINTLIST) { } else if (!PRIM->TME && PRIM->PRIM != GS_POINTLIST) {
// Standard (inaccurate) colclip // Standard (inaccurate) colclip
ps_sel.colclip = 1; ps_sel.colclip = 1;
accumulation_blend = false;
GL_INS("COLCLIP ENABLED (blending is %d/%d/%d/%d)", ALPHA.A, ALPHA.B, ALPHA.C, ALPHA.D); GL_INS("COLCLIP ENABLED (blending is %d/%d/%d/%d)", ALPHA.A, ALPHA.B, ALPHA.C, ALPHA.D);
} }
} }
// Note: Option is duplicated, one impact the blend unit / the other the shader.
if (accumulation_blend && m_sw_blending) {
om_bsel.accu = ps_sel.blend_accu = 1;
sw_blending_base = true;
}
bool all_blend_sw; bool all_blend_sw;
switch (m_sw_blending) { switch (m_sw_blending) {
case ACC_BLEND_ULTRA: all_blend_sw = true; break; case ACC_BLEND_ULTRA: all_blend_sw = true; break;