From e08e0cba33e068f165d2e0cbcaf09f63f8cf8098 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Mon, 15 Feb 2021 23:12:24 -0800 Subject: [PATCH] GPU: Remove clear framebuf on first use speedhack. Wasn't helping much. --- Core/Config.cpp | 2 -- Core/Config.h | 1 - GPU/Common/FramebufferManagerCommon.cpp | 15 +-------------- UI/GameSettingsScreen.cpp | 9 --------- 4 files changed, 1 insertion(+), 26 deletions(-) diff --git a/Core/Config.cpp b/Core/Config.cpp index 0299b56ebd..014e53c07d 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -820,8 +820,6 @@ static ConfigSetting graphicsSettings[] = { ConfigSetting("InflightFrames", &g_Config.iInflightFrames, 3, true, false), ConfigSetting("RenderDuplicateFrames", &g_Config.bRenderDuplicateFrames, false, true, true), - ConfigSetting("ClearFramebuffersOnFirstUseHack", &g_Config.bClearFramebuffersOnFirstUseHack, false, true, true), - ConfigSetting(false), }; diff --git a/Core/Config.h b/Core/Config.h index 13bce8a366..8eeeea1e10 100644 --- a/Core/Config.h +++ b/Core/Config.h @@ -167,7 +167,6 @@ public: int iFrameSkipType; int iUnthrottleMode; // See UnthrottleMode in ConfigValues.h. bool bAutoFrameSkip; - bool bClearFramebuffersOnFirstUseHack; bool bEnableCardboardVR; // Cardboard Master Switch int iCardboardScreenSize; // Screen Size (in %) diff --git a/GPU/Common/FramebufferManagerCommon.cpp b/GPU/Common/FramebufferManagerCommon.cpp index f30a05bee5..25e6971e40 100644 --- a/GPU/Common/FramebufferManagerCommon.cpp +++ b/GPU/Common/FramebufferManagerCommon.cpp @@ -703,20 +703,7 @@ void FramebufferManagerCommon::NotifyRenderFramebufferSwitched(VirtualFramebuffe if (useBufferedRendering_) { if (vfb->fbo) { shaderManager_->DirtyLastShader(); - if (g_Config.bClearFramebuffersOnFirstUseHack) { - // HACK: Some tiled mobile GPUs benefit IMMENSELY from clearing an FBO before rendering - // to it (or in Vulkan, clear during framebuffer load). This is a hack to force this - // the first time a framebuffer is bound for rendering in a frame. - // - // Quite unsafe as it might kill some feedback effects. - if (vfb->last_frame_render != gpuStats.numFlips) { - draw_->BindFramebufferAsRenderTarget(vfb->fbo, { Draw::RPAction::CLEAR, Draw::RPAction::CLEAR, Draw::RPAction::CLEAR }, "FramebufferSwitch"); - } else { - draw_->BindFramebufferAsRenderTarget(vfb->fbo, { Draw::RPAction::KEEP, Draw::RPAction::KEEP, Draw::RPAction::KEEP }, "FramebufferSwitch"); - } - } else { - draw_->BindFramebufferAsRenderTarget(vfb->fbo, { Draw::RPAction::KEEP, Draw::RPAction::KEEP, Draw::RPAction::KEEP }, "FramebufferSwitch"); - } + draw_->BindFramebufferAsRenderTarget(vfb->fbo, { Draw::RPAction::KEEP, Draw::RPAction::KEEP, Draw::RPAction::KEEP }, "FramebufferSwitch"); } else { // This should only happen very briefly when toggling useBufferedRendering_. ResizeFramebufFBO(vfb, vfb->width, vfb->height, true); diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index d5eed1fed3..526eafd389 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -448,15 +448,6 @@ void GameSettingsScreen::CreateViews() { return !g_Config.bSoftwareRendering && g_Config.bHardwareTransform; }); - CheckBox *clearHack = graphicsSettings->Add(new CheckBox(&g_Config.bClearFramebuffersOnFirstUseHack, gr->T("Clear Speedhack", "Clear framebuffers on first use (speedhack)"))); - clearHack->OnClick.Add([=](EventParams &e) { - settingInfo_->Show(gr->T("ClearSpeedhack Tip", "Sometimes faster (mostly on mobile devices), may cause glitches"), e.v); - return UI::EVENT_CONTINUE; - }); - clearHack->SetEnabledFunc([] { - return !g_Config.bSoftwareRendering; - }); - CheckBox *texBackoff = graphicsSettings->Add(new CheckBox(&g_Config.bTextureBackoffCache, gr->T("Lazy texture caching", "Lazy texture caching (speedup)"))); texBackoff->SetDisabledPtr(&g_Config.bSoftwareRendering);