GSdx-d3d: optimize colclip 0 port from OpenGL.

Commits:
7979dec5b0
15b934eb2a
This commit is contained in:
lightningterror 2018-10-03 07:41:10 +02:00
parent d5700a8508
commit 379d9e4b88
1 changed files with 10 additions and 1 deletions

View File

@ -533,7 +533,16 @@ void GSRendererDX::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sourc
bool colclip_wrap = m_env.COLCLAMP.CLAMP == 0 && !tex && PRIM->PRIM != GS_POINTLIST; bool colclip_wrap = m_env.COLCLAMP.CLAMP == 0 && !tex && PRIM->PRIM != GS_POINTLIST;
if (colclip_wrap) if (colclip_wrap)
{ {
m_ps_sel.colclip = 1; if ((m_context->ALPHA.A == m_context->ALPHA.B) || !om_bsel.abe) // Optimize-away colclip
{
// No addition neither substraction so no risk of overflow the [0:255] range.
colclip_wrap = false;
}
else
{
m_ps_sel.colclip = 1;
// fprintf(stderr, "COLCLIP ENABLED (blending is %d/%d/%d/%d)\n", m_context->ALPHA.A, m_context->ALPHA.B, m_context->ALPHA.C, m_context->ALPHA.D);
}
} }
m_ps_sel.clr1 = om_bsel.IsCLR1(); m_ps_sel.clr1 = om_bsel.IsCLR1();