Skip to content

Commit

Permalink
GPU: Allow skipping discard when write disabled.
Browse files Browse the repository at this point in the history
Even if we depth test, if we don't write, we can still force alpha to
zero.
  • Loading branch information
unknownbrackets committed Jul 28, 2018
1 parent 8e49fa9 commit 5ccd3ee
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion GPU/Common/GPUStateUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5ccd3ee

Please sign in to comment.