Skip to content

Commit

Permalink
GSdx: Fix Alpha test value initialization
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ssakash authored and gregory38 committed Mar 11, 2017
1 parent 7d3c850 commit f423cf7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion plugins/GSdx/GSRendererDX.cpp
Expand Up @@ -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;
}

Expand Down
4 changes: 3 additions & 1 deletion plugins/GSdx/GSRendererOGL.cpp
Expand Up @@ -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;
}

Expand Down

0 comments on commit f423cf7

Please sign in to comment.