Skip to content
Permalink
Browse files

GPU: Improve non dual source stencil replace.

If we're replacing with a constant FF, we can make it work more often.
Fixes #11249.
  • Loading branch information...
unknownbrackets committed Apr 7, 2019
1 parent b5db387 commit 00d088ab58b78ce5f42fe1c99821651a51c6145b
Showing with 7 additions and 1 deletion.
  1. +7 −1 GPU/Common/GPUStateUtils.cpp
@@ -1171,7 +1171,13 @@ void ConvertBlendState(GenericBlendState &blendState, bool allowShaderBlend) {
break;
}
} else if (!IsStencilTestOutputDisabled()) {
switch (ReplaceAlphaWithStencilType()) {
StencilValueType stencilValue = ReplaceAlphaWithStencilType();
if (stencilValue == STENCIL_VALUE_UNIFORM && constantAlpha == 0x00) {
stencilValue = STENCIL_VALUE_ZERO;
} else if (stencilValue == STENCIL_VALUE_UNIFORM && constantAlpha == 0xFF) {
stencilValue = STENCIL_VALUE_ONE;
}
switch (stencilValue) {
case STENCIL_VALUE_KEEP:
blendState.setFactors(glBlendFuncA, glBlendFuncB, BlendFactor::ZERO, BlendFactor::ONE);
break;

0 comments on commit 00d088a

Please sign in to comment.
You can’t perform that action at this time.