Merge pull request #13411 from hrydgard/clear-speedhack-option

Add option for the clear-fb-on-first-use speedhack.
This commit is contained in:
Unknown W. Brackets authored and GitHub committed 2020-09-10 22:59:04 -04:00
commit e3dd3e597c
5 files changed
+13 -6

No files matched your search

+2
View File
@@ -819,6 +819,8 @@ 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),
};
+1
View File
@@ -166,6 +166,7 @@ public:
int iFrameSkipType;
int iUnthrottleMode; // See UnthrottleMode in ConfigValues.h.
bool bAutoFrameSkip;
bool bClearFramebuffersOnFirstUseHack;
bool bEnableCardboardVR; // Cardboard Master Switch
int iCardboardScreenSize; // Screen Size (in %)
+1 -5
View File
@@ -44,10 +44,6 @@ FramebufferManagerCommon::FramebufferManagerCommon(Draw::DrawContext *draw)
: draw_(draw),
displayFormat_(GE_FORMAT_565) {
presentation_ = new PresentationCommon(draw);
// See comment from where it's used below.
// As for the use of IsGLES, just the way it was. Scary to change it.
clearFramebufferOnFirstUseHack_ = gl_extensions.IsGLES;
}
FramebufferManagerCommon::~FramebufferManagerCommon() {
@@ -536,7 +532,7 @@ void FramebufferManagerCommon::NotifyRenderFramebufferSwitched(VirtualFramebuffe
if (useBufferedRendering_) {
if (vfb->fbo) {
shaderManager_->DirtyLastShader();
if (clearFramebufferOnFirstUseHack_) {
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.
-1
View File
@@ -396,7 +396,6 @@ protected:
std::vector<VirtualFramebuffer *> bvfbs_; // blitting framebuffers (for download)
bool gameUsesSequentialCopies_ = false;
bool clearFramebufferOnFirstUseHack_ = false;
// Sampled in BeginFrame for safety.
float renderWidth_ = 0.0f;
+9
View File
@@ -415,6 +415,15 @@ 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);