From be8c74cabea63280b0127b2c161048651406115d Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Mon, 31 Jan 2022 19:32:46 -0800 Subject: [PATCH] softgpu: Avoid flush on END. We only, but always, flush when exiting list interp in FinishDeferred. It's not necessary at END, and hurts for simple signals that don't stop list processing. --- GPU/GPUCommon.cpp | 6 ++++-- GPU/GPUCommon.h | 1 + GPU/Software/SoftGpu.cpp | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/GPU/GPUCommon.cpp b/GPU/GPUCommon.cpp index e1a1fdbd2a..dc2a8e860b 100644 --- a/GPU/GPUCommon.cpp +++ b/GPU/GPUCommon.cpp @@ -1348,7 +1348,8 @@ void GPUCommon::Execute_Ret(u32 op, u32 diff) { } void GPUCommon::Execute_End(u32 op, u32 diff) { - Flush(); + if (flushOnParams_) + Flush(); const u32 prev = Memory::ReadUnchecked_U32(currentList->pc - 4); UpdatePC(currentList->pc, currentList->pc); @@ -2408,7 +2409,8 @@ void GPUCommon::FastLoadBoneMatrix(u32 target) { } if (!g_Config.bSoftwareSkinning) { - Flush(); + if (flushOnParams_) + Flush(); gstate_c.Dirty(uniformsToDirty); } else { gstate_c.deferredVertTypeDirty |= uniformsToDirty; diff --git a/GPU/GPUCommon.h b/GPU/GPUCommon.h index 07954fefc4..74ec59ac87 100644 --- a/GPU/GPUCommon.h +++ b/GPU/GPUCommon.h @@ -318,6 +318,7 @@ protected: TextureCacheCommon *textureCache_ = nullptr; DrawEngineCommon *drawEngineCommon_ = nullptr; ShaderManagerCommon *shaderManager_ = nullptr; + bool flushOnParams_ = true; GraphicsContext *gfxCtx_; Draw::DrawContext *draw_; diff --git a/GPU/Software/SoftGpu.cpp b/GPU/Software/SoftGpu.cpp index be05f29a4e..faefbc9943 100644 --- a/GPU/Software/SoftGpu.cpp +++ b/GPU/Software/SoftGpu.cpp @@ -438,6 +438,9 @@ SoftGPU::SoftGPU(GraphicsContext *gfxCtx, Draw::DrawContext *draw) // Push the initial CLUT buffer in case it's all zero (we push only on change.) drawEngine_->transformUnit.NotifyClutUpdate(clut); + // No need to flush for simple parameter changes. + flushOnParams_ = false; + if (gfxCtx && draw) { presentation_ = new PresentationCommon(draw_); presentation_->SetLanguage(draw_->GetShaderLanguageDesc().shaderLanguage);