Skip to content

Commit 3ce0c91

Browse files
Akashjerrys123111
authored andcommitted
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.
1 parent ff1fefe commit 3ce0c91

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

plugins/GSdx/GSRendererDX.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,12 +607,14 @@ void GSRendererDX::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sourc
607607
default: __assume(0);
608608
}
609609

610+
// Depth test should be disabled when depth writes are masked and similarly, Alpha test must be disabled
611+
// when writes to all of the alpha bits in the Framebuffer are masked.
610612
if (ate_RGBA_then_Z) {
611613
z = !m_context->ZBUF.ZMSK;
612614
r = g = b = a = false;
613615
} else if (ate_RGB_then_ZA) {
614616
z = !m_context->ZBUF.ZMSK;
615-
a = !!(m_context->FRAME.FBMSK & 0xFF000000);
617+
a = (m_context->FRAME.FBMSK & 0xFF000000) != 0xFF000000;
616618
r = g = b = false;
617619
}
618620

plugins/GSdx/GSRendererOGL.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1585,12 +1585,14 @@ void GSRendererOGL::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sour
15851585
default: __assume(0);
15861586
}
15871587

1588+
// Depth test should be disabled when depth writes are masked and similarly, Alpha test must be disabled
1589+
// when writes to all of the alpha bits in the Framebuffer are masked.
15881590
if (ate_RGBA_then_Z) {
15891591
z = !m_context->ZBUF.ZMSK;
15901592
r = g = b = a = false;
15911593
} else if (ate_RGB_then_ZA) {
15921594
z = !m_context->ZBUF.ZMSK;
1593-
a = !!(m_context->FRAME.FBMSK & 0xFF000000);
1595+
a = (m_context->FRAME.FBMSK & 0xFF000000) != 0xFF000000;
15941596
r = g = b = false;
15951597
}
15961598

0 commit comments

Comments
 (0)