Skip to content

Commit

Permalink
Dest alpha mask: Try some rules that seem to make sense from what we …
Browse files Browse the repository at this point in the history
…know now.
  • Loading branch information
hrydgard committed Dec 4, 2013
1 parent 7881cf2 commit 10b9e83
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions GPU/GLES/StateMapping.cpp
Expand Up @@ -339,6 +339,19 @@ void TransformDrawEngine::ApplyDrawState(int prim) {
bool gmask = ((gstate.pmskc >> 8) & 0xFF) < 128;
bool bmask = ((gstate.pmskc >> 16) & 0xFF) < 128;
bool amask = (gstate.pmska & 0xFF) < 128;

if (gstate.isModeClear()) {
// Clear mode? Obey the clear mode alpha mask (works opposite)
if (gstate.isClearModeAlphaMask()) {
amask = false;
}
} else {
// Let's not write to alpha if stencil isn't enabled.
if (!gstate.isStencilTestEnabled()) {
amask = false;
}
}

glstate.colorMask.set(rmask, gmask, bmask, amask);

// Stencil Test
Expand Down

2 comments on commit 10b9e83

@hrydgard
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course, this will probably screw up 3rd birthday again...

@unknownbrackets
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK, amask applies only to stencil, so if stencil testing is disabled it ought to be off completely.

Oh, never mind, misread it.

-[Unknown]

Please sign in to comment.