Move the computation of simulate-logic shader type earlier

This commit is contained in:
Henrik Rydgård 2022-09-03 23:32:01 +02:00
parent 87b14fe1c2
commit d35749bfc8
3 changed files with 4 additions and 1 deletions

View File

@ -1063,6 +1063,8 @@ void ConvertBlendState(GenericBlendState &blendState, bool forceReplaceBlend) {
}
blendState.replaceBlend = replaceBlend;
blendState.simulateLogicOpType = SimulateLogicOpShaderTypeIfNeeded();
ReplaceAlphaType replaceAlphaWithStencil = ReplaceAlphaWithStencil(replaceBlend);
blendState.replaceAlphaWithStencil = replaceAlphaWithStencil;

View File

@ -146,6 +146,7 @@ struct GenericBlendState {
// Shader generation state
ReplaceAlphaType replaceAlphaWithStencil;
ReplaceBlendType replaceBlend;
SimulateLogicOpType simulateLogicOpType;
// Resulting hardware blend state
bool blendEnabled;

View File

@ -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.