mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Add option for the clear-fb-on-first-use speedhack. See #13295
This commit is contained in:
parent
10520470d1
commit
406fed7914
5 changed files with 13 additions and 6 deletions
|
@ -818,6 +818,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),
|
||||
};
|
||||
|
||||
|
|
|
@ -165,6 +165,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 %)
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue