diff --git a/GPU/Common/GPUStateUtils.cpp b/GPU/Common/GPUStateUtils.cpp index 33548c2f5d..4cce911b59 100644 --- a/GPU/Common/GPUStateUtils.cpp +++ b/GPU/Common/GPUStateUtils.cpp @@ -1063,6 +1063,8 @@ void ConvertBlendState(GenericBlendState &blendState, bool forceReplaceBlend) { } blendState.replaceBlend = replaceBlend; + blendState.simulateLogicOpType = SimulateLogicOpShaderTypeIfNeeded(); + ReplaceAlphaType replaceAlphaWithStencil = ReplaceAlphaWithStencil(replaceBlend); blendState.replaceAlphaWithStencil = replaceAlphaWithStencil; diff --git a/GPU/Common/GPUStateUtils.h b/GPU/Common/GPUStateUtils.h index cfa5fb33fb..2d9fa62fae 100644 --- a/GPU/Common/GPUStateUtils.h +++ b/GPU/Common/GPUStateUtils.h @@ -146,6 +146,7 @@ struct GenericBlendState { // Shader generation state ReplaceAlphaType replaceAlphaWithStencil; ReplaceBlendType replaceBlend; + SimulateLogicOpType simulateLogicOpType; // Resulting hardware blend state bool blendEnabled; diff --git a/GPU/Common/ShaderId.cpp b/GPU/Common/ShaderId.cpp index 0c5ffd2d52..53176ebcba 100644 --- a/GPU/Common/ShaderId.cpp +++ b/GPU/Common/ShaderId.cpp @@ -267,7 +267,7 @@ void ComputeFragmentShaderID(FShaderID *id_out, const ComputedPipelineState &pip ReplaceBlendType replaceBlend = pipelineState.blendState.replaceBlend; ReplaceAlphaType stencilToAlpha = pipelineState.blendState.replaceAlphaWithStencil; - SimulateLogicOpType simulateLogicOpType = SimulateLogicOpShaderTypeIfNeeded(); + SimulateLogicOpType simulateLogicOpType = pipelineState.blendState.simulateLogicOpType; // All texfuncs except replace are the same for RGB as for RGBA with full alpha. // Note that checking this means that we must dirty the fragment shader ID whenever textureFullAlpha changes.