Browse files

GPU: Allow skipping discard when write disabled.

Even if we depth test, if we don't write, we can still force alpha to
  • Loading branch information...
unknownbrackets committed Jul 28, 2018
1 parent 8e49fa9 commit 5ccd3ee4dcf4048815cc5f43837f4f9c15358f88
Showing with 3 additions and 1 deletion.
  1. +3 −1 GPU/Common/GPUStateUtils.cpp
@@ -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;

0 comments on commit 5ccd3ee

Please sign in to comment.