Skip to content

Commit

Permalink
softgpu: Avoid flush on END.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
unknownbrackets committed Feb 1, 2022
1 parent 2a82d39 commit be8c74c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 4 additions & 2 deletions GPU/GPUCommon.cpp
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions GPU/GPUCommon.h
Expand Up @@ -318,6 +318,7 @@ class GPUCommon : public GPUInterface, public GPUDebugInterface {
TextureCacheCommon *textureCache_ = nullptr;
DrawEngineCommon *drawEngineCommon_ = nullptr;
ShaderManagerCommon *shaderManager_ = nullptr;
bool flushOnParams_ = true;

GraphicsContext *gfxCtx_;
Draw::DrawContext *draw_;
Expand Down
3 changes: 3 additions & 0 deletions GPU/Software/SoftGpu.cpp
Expand Up @@ -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);
Expand Down

0 comments on commit be8c74c

Please sign in to comment.