Skip to content
Permalink
Browse files

Merge pull request #11964 from unknownbrackets/gpu-stencil-blend

GPU: Improve non dual source stencil replace
  • Loading branch information...
hrydgard committed Apr 7, 2019
2 parents b5db387 + 00d088a commit b56c66e88926551392d48ceea435a15caf11b36a
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 b56c66e

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