Don't start blending in the shader just because there's bitmasks, if blend is disabled.

This commit is contained in:
Henrik Rydgård 2022-09-12 12:17:32 +02:00
parent a2eaad5445
commit d9989ffc16
2 changed files with 6 additions and 2 deletions

View File

@ -1058,8 +1058,10 @@ static void ConvertBlendState(GenericBlendState &blendState, bool forceReplaceBl
ReplaceBlendType replaceBlend = ReplaceBlendWithShader(gstate_c.framebufFormat);
if (forceReplaceBlend) {
replaceBlend = REPLACE_BLEND_READ_FRAMEBUFFER;
// Enforce blend replacement if enabled. If not, shouldn't do anything of course.
replaceBlend = blendState.blendEnabled ? REPLACE_BLEND_READ_FRAMEBUFFER : REPLACE_BLEND_NO;
}
blendState.replaceBlend = replaceBlend;
blendState.simulateLogicOpType = SimulateLogicOpShaderTypeIfNeeded();

View File

@ -245,7 +245,9 @@ struct ComputedPipelineState {
void Convert(bool shaderBitOpsSupported);
bool FramebufferRead() const {
return blendState.applyFramebufferRead;
// If blending is off, its applyFramebufferRead can be false even after state propagation.
// So it's not enough to check just that one.
return blendState.applyFramebufferRead || maskState.applyFramebufferRead || logicState.applyFramebufferRead;
}
};