add an option to disable framebuffer fetch

This commit is contained in:
Samuliak 2025-01-11 10:59:28 +01:00
parent 217e2edda3
commit f4985c481e
No known key found for this signature in database
5 changed files with 21 additions and 3 deletions

View file

@ -87,7 +87,7 @@ MetalRenderer::MetalRenderer()
// Feature support
m_isAppleGPU = m_device->supportsFamily(MTL::GPUFamilyApple1);
m_supportsFramebufferFetch = m_device->supportsFamily(MTL::GPUFamilyApple2);
m_supportsFramebufferFetch = GetConfig().framebuffer_fetch.GetValue() ? m_device->supportsFamily(MTL::GPUFamilyApple2) : false;
m_hasUnifiedMemory = m_device->hasUnifiedMemory();
m_supportsMetal3 = m_device->supportsFamily(MTL::GPUFamilyMetal3);
m_recommendedMaxVRAMUsage = m_device->recommendedMaxWorkingSetSize();

View file

@ -338,6 +338,7 @@ void CemuConfig::Load(XMLConfigParser& parser)
#endif
gdb_port = debug.get("GDBPort", 1337);
gpu_capture_dir = debug.get("GPUCaptureDir", "");
framebuffer_fetch = debug.get("FramebufferFetch", true);
// input
auto input = parser.get("Input");
@ -540,7 +541,8 @@ void CemuConfig::Save(XMLConfigParser& parser)
debug.set("CrashDumpUnix", crash_dump.GetValue());
#endif
debug.set("GDBPort", gdb_port);
debug.set("GPUCaptureDir", gpu_capture_dir.GetValue());
debug.set("GPUCaptureDir", gpu_capture_dir);
debug.set("FramebufferFetch", framebuffer_fetch);
// input
auto input = config.set("Input");

View file

@ -527,7 +527,8 @@ struct CemuConfig
// debug
ConfigValueBounds<CrashDump> crash_dump{ CrashDump::Disabled };
ConfigValue<uint16> gdb_port{ 1337 };
ConfigValue<std::string> gpu_capture_dir{};
ConfigValue<std::string> gpu_capture_dir{ "" };
ConfigValue<bool> framebuffer_fetch{ true };
void Load(XMLConfigParser& parser);
void Save(XMLConfigParser& parser);

View file

@ -910,6 +910,18 @@ wxPanel* GeneralSettings2::AddDebugPage(wxNotebook* notebook)
debug_panel_sizer->Add(debug_row, 0, wxALL | wxEXPAND, 5);
}
{
auto* debug_row = new wxFlexGridSizer(0, 2, 0, 0);
debug_row->SetFlexibleDirection(wxBOTH);
debug_row->SetNonFlexibleGrowMode(wxFLEX_GROWMODE_SPECIFIED);
m_framebuffer_fetch = new wxCheckBox(panel, wxID_ANY, _("Framebuffer fetch"));
m_framebuffer_fetch->SetToolTip(_("Enable framebuffer fetch for eligible textures on supported devices."));
debug_row->Add(m_framebuffer_fetch, 0, wxALL | wxEXPAND, 5);
debug_panel_sizer->Add(debug_row, 0, wxALL | wxEXPAND, 5);
}
panel->SetSizerAndFit(debug_panel_sizer);
return panel;
@ -1121,6 +1133,7 @@ void GeneralSettings2::StoreConfig()
config.crash_dump = (CrashDump)m_crash_dump->GetSelection();
config.gdb_port = m_gdb_port->GetValue();
config.gpu_capture_dir = m_gpu_capture_dir->GetValue().utf8_string();
config.framebuffer_fetch = m_framebuffer_fetch->IsChecked();
g_config.Save();
}
@ -1816,6 +1829,7 @@ void GeneralSettings2::ApplyConfig()
m_crash_dump->SetSelection((int)config.crash_dump.GetValue());
m_gdb_port->SetValue(config.gdb_port.GetValue());
m_gpu_capture_dir->SetValue(wxHelper::FromUtf8(config.gpu_capture_dir.GetValue()));
m_framebuffer_fetch->SetValue(config.framebuffer_fetch);
}
void GeneralSettings2::OnAudioAPISelected(wxCommandEvent& event)

View file

@ -80,6 +80,7 @@ private:
wxChoice* m_crash_dump;
wxSpinCtrl* m_gdb_port;
wxTextCtrl* m_gpu_capture_dir;
wxCheckBox* m_framebuffer_fetch;
void OnAccountCreate(wxCommandEvent& event);
void OnAccountDelete(wxCommandEvent& event);