GSdx: Fix Alpha test value initialization

Alpha test should only be disabled when writes to all of the alpha bits in the Framebuffer are masked. Fixes a regression in Dragon Ball Z: Budokai 3 scouter image rendering.
This commit is contained in:
Akash 2017-03-11 20:30:40 +05:30 committed by Gregory Hainaut
parent 7d3c850813
commit f423cf73c4
2 changed files with 6 additions and 2 deletions

View File

@ -607,12 +607,14 @@ void GSRendererDX::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sourc
default: __assume(0);
}
// Depth test should be disabled when depth writes are masked and similarly, Alpha test must be disabled
// when writes to all of the alpha bits in the Framebuffer are masked.
if (ate_RGBA_then_Z) {
z = !m_context->ZBUF.ZMSK;
r = g = b = a = false;
} else if (ate_RGB_then_ZA) {
z = !m_context->ZBUF.ZMSK;
a = !!(m_context->FRAME.FBMSK & 0xFF000000);
a = (m_context->FRAME.FBMSK & 0xFF000000) != 0xFF000000;
r = g = b = false;
}

View File

@ -1585,12 +1585,14 @@ void GSRendererOGL::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sour
default: __assume(0);
}
// Depth test should be disabled when depth writes are masked and similarly, Alpha test must be disabled
// when writes to all of the alpha bits in the Framebuffer are masked.
if (ate_RGBA_then_Z) {
z = !m_context->ZBUF.ZMSK;
r = g = b = a = false;
} else if (ate_RGB_then_ZA) {
z = !m_context->ZBUF.ZMSK;
a = !!(m_context->FRAME.FBMSK & 0xFF000000);
a = (m_context->FRAME.FBMSK & 0xFF000000) != 0xFF000000;
r = g = b = false;
}