From a062e5192bfa2d0743642c41130189d171ce2bf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Wed, 16 Oct 2024 15:25:53 +0200 Subject: [PATCH] Fix issue where PresentedThisFrame didn't work on SoftGPU, causing issues --- GPU/GPUCommon.cpp | 4 ---- GPU/GPUCommon.h | 2 -- GPU/GPUCommonHW.cpp | 4 ++++ GPU/GPUCommonHW.h | 2 ++ GPU/Software/SoftGpu.cpp | 4 ++++ GPU/Software/SoftGpu.h | 2 ++ UI/GameSettingsScreen.cpp | 2 +- 7 files changed, 13 insertions(+), 7 deletions(-) diff --git a/GPU/GPUCommon.cpp b/GPU/GPUCommon.cpp index a97dd7958f..a48ab68f7c 100644 --- a/GPU/GPUCommon.cpp +++ b/GPU/GPUCommon.cpp @@ -722,10 +722,6 @@ void GPUCommon::PSPFrame() { GPURecord::NotifyBeginFrame(); } -bool GPUCommon::PresentedThisFrame() const { - return framebufferManager_ ? framebufferManager_->PresentedThisFrame() : true; -} - void GPUCommon::SlowRunLoop(DisplayList &list) { const bool dumpThisFrame = dumpThisFrame_; while (downcount > 0) { diff --git a/GPU/GPUCommon.h b/GPU/GPUCommon.h index f5732b3f1f..980a19ab8c 100644 --- a/GPU/GPUCommon.h +++ b/GPU/GPUCommon.h @@ -224,8 +224,6 @@ public: fullInfo = reportingFullInfo_; } - bool PresentedThisFrame() const override; - protected: void ClearCacheNextFrame() override {} diff --git a/GPU/GPUCommonHW.cpp b/GPU/GPUCommonHW.cpp index 8d835da5ff..d4438501aa 100644 --- a/GPU/GPUCommonHW.cpp +++ b/GPU/GPUCommonHW.cpp @@ -540,6 +540,10 @@ void GPUCommonHW::CopyDisplayToOutput(bool reallyDirty) { gstate_c.Dirty(DIRTY_TEXTURE_IMAGE); } +bool GPUCommonHW::PresentedThisFrame() const { + return framebufferManager_->PresentedThisFrame(); +} + void GPUCommonHW::DoState(PointerWrap &p) { GPUCommon::DoState(p); diff --git a/GPU/GPUCommonHW.h b/GPU/GPUCommonHW.h index 05673e2d84..7e3671cff6 100644 --- a/GPU/GPUCommonHW.h +++ b/GPU/GPUCommonHW.h @@ -68,6 +68,8 @@ public: void FastRunLoop(DisplayList &list) override; void ExecuteOp(u32 op, u32 diff) override; + bool PresentedThisFrame() const override; + private: void CheckDepthUsage(VirtualFramebuffer *vfb) override; void CheckFlushOp(int cmd, u32 diff); diff --git a/GPU/Software/SoftGpu.cpp b/GPU/Software/SoftGpu.cpp index 6cc4c37cf7..a8cc23b299 100644 --- a/GPU/Software/SoftGpu.cpp +++ b/GPU/Software/SoftGpu.cpp @@ -656,6 +656,10 @@ void SoftGPU::CopyDisplayToOutput(bool reallyDirty) { MarkDirty(displayFramebuf_, displayStride_, 272, displayFormat_, SoftGPUVRAMDirty::CLEAR); } +bool SoftGPU::PresentedThisFrame() const { + return presentation_->PresentedThisFrame(); +} + void SoftGPU::MarkDirty(uint32_t addr, uint32_t stride, uint32_t height, GEBufferFormat fmt, SoftGPUVRAMDirty value) { uint32_t bytes = height * stride * (fmt == GE_FORMAT_8888 ? 4 : 2); MarkDirty(addr, bytes, value); diff --git a/GPU/Software/SoftGpu.h b/GPU/Software/SoftGpu.h index 5f2499c34f..870aa95810 100644 --- a/GPU/Software/SoftGpu.h +++ b/GPU/Software/SoftGpu.h @@ -209,6 +209,8 @@ public: typedef void (SoftGPU::*CmdFunc)(u32 op, u32 diff); + bool PresentedThisFrame() const override; + protected: void FastRunLoop(DisplayList &list) override; void CopyToCurrentFboFromDisplayRam(int srcwidth, int srcheight); diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 68e3c1cbdb..60e56c5ca0 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -1001,7 +1001,7 @@ void GameSettingsScreen::CreateToolsSettings(UI::ViewGroup *tools) { tools->Add(new ItemHeader(ms->T("Tools"))); - const bool showRetroAchievements = true; + const bool showRetroAchievements = true; // System_GetPropertyInt(SYSPROP_DEVICE_TYPE) != DEVICE_TYPE_VR; if (showRetroAchievements) { auto retro = tools->Add(new Choice(sy->T("RetroAchievements"))); retro->OnClick.Add([=](UI::EventParams &) -> UI::EventReturn {