GPU: Allow skipping discard when write disabled.

Even if we depth test, if we don't write, we can still force alpha to
zero.
This commit is contained in:
Unknown W. Brackets 2018-07-27 20:10:26 -07:00
parent 8e49fa988c
commit 5ccd3ee4dc

View file

@ -115,7 +115,9 @@ bool IsAlphaTestTriviallyTrue() {
bool NeedsTestDiscard() {
// We assume this is called only when enabled and not trivially true (may also be for color testing.)
if (gstate.isStencilTestEnabled() || gstate.isDepthTestEnabled())
if (gstate.isStencilTestEnabled() && (gstate.pmska & 0xFF) != 0xFF)
return true;
if (gstate.isDepthTestEnabled() && gstate.isDepthWriteEnabled())
return true;
if (!gstate.isAlphaBlendEnabled())
return true;