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.replaceBlend = replaceBlend;
blendState.simulateLogicOpType = SimulateLogicOpShaderTypeIfNeeded();
ReplaceAlphaType replaceAlphaWithStencil = ReplaceAlphaWithStencil(replaceBlend); ReplaceAlphaType replaceAlphaWithStencil = ReplaceAlphaWithStencil(replaceBlend);
blendState.replaceAlphaWithStencil = replaceAlphaWithStencil; blendState.replaceAlphaWithStencil = replaceAlphaWithStencil;

View File

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

View File

@ -267,7 +267,7 @@ void ComputeFragmentShaderID(FShaderID *id_out, const ComputedPipelineState &pip
ReplaceBlendType replaceBlend = pipelineState.blendState.replaceBlend; ReplaceBlendType replaceBlend = pipelineState.blendState.replaceBlend;
ReplaceAlphaType stencilToAlpha = pipelineState.blendState.replaceAlphaWithStencil; 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. // 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. // Note that checking this means that we must dirty the fragment shader ID whenever textureFullAlpha changes.