mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-16 16:00:30 +02:00
Set amask based on ReplaceAlphaWithStencil()
This commit is contained in:
1 parent
ca0fd61998
commit
e5059d2c96
1 file changed
+14
-9
@@ -407,18 +407,23 @@ void TransformDrawEngine::ApplyDrawState(int prim) {
|
||||
bool rmask = (gstate.pmskc & 0xFF) < 128;
|
||||
bool gmask = ((gstate.pmskc >> 8) & 0xFF) < 128;
|
||||
bool bmask = ((gstate.pmskc >> 16) & 0xFF) < 128;
|
||||
bool amask = (gstate.pmska & 0xFF) < 128;
|
||||
|
||||
// Let's not write to alpha if stencil isn't enabled.
|
||||
if (!gstate.isStencilTestEnabled()) {
|
||||
bool amask;
|
||||
ReplaceAlphaType stencilToAlpha = ReplaceAlphaWithStencil();
|
||||
|
||||
switch (stencilToAlpha) {
|
||||
case REPLACE_ALPHA_DUALSOURCE:
|
||||
amask = (gstate.pmska & 0xFF) < 128;
|
||||
break;
|
||||
|
||||
case REPLACE_ALPHA_YES:
|
||||
amask = true;
|
||||
break;
|
||||
|
||||
case REPLACE_ALPHA_NO:
|
||||
amask = false;
|
||||
} else {
|
||||
// If the stencil type is set to KEEP, we shouldn't write to the stencil/alpha channel.
|
||||
if (ReplaceAlphaWithStencilType() == STENCIL_VALUE_KEEP) {
|
||||
amask = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
glstate.colorMask.set(rmask, gmask, bmask, amask);
|
||||
|
||||
// Stencil Test
|
||||
|
||||
Reference in new issue
Block a user