Qt: Add FSR options to settings GUI (#3504)

* Qt: Add FSR settings to settings GUI

* Move FSR settings from Imgui.ini to main config

* move passing fsr settings to presenter constuctor

* cleanup: use struct instead of function call

* cleanup: make variable names consistent with others

* Update fsr settings real-time in qt, save button in Imgui

* Linux build fix, missing running game check

* syntax fix

* Change gamerunning checks to if (presenter)
This commit is contained in:
rainmakerv2
2025-09-03 03:03:33 +08:00
committed by GitHub
parent d9b4618085
commit 77b1d11796
8 changed files with 189 additions and 35 deletions

View File

@@ -104,6 +104,16 @@ void L::DrawMenuBar() {
EndDisabled();
}
EndDisabled();
if (Button("Save")) {
Config::setFsrEnabled(fsr.enable);
Config::setRcasEnabled(fsr.use_rcas);
Config::setRcasAttenuation(static_cast<int>(fsr.rcas_attenuation * 1000));
Config::save(Common::FS::GetUserPath(Common::FS::PathType::UserDir) /
"config.toml");
CloseCurrentPopup();
}
ImGui::EndMenu();
}
ImGui::EndMenu();

View File

@@ -30,26 +30,12 @@ void LoadOptionsConfig(const char* line) {
Options.frame_dump_render_on_collapse = i != 0;
return;
}
if (sscanf(line, "fsr_enabled=%d", &i) == 1) {
presenter->GetFsrSettingsRef().enable = i != 0;
return;
}
if (sscanf(line, "fsr_rcas_enabled=%d", &i) == 1) {
presenter->GetFsrSettingsRef().use_rcas = i != 0;
return;
}
if (sscanf(line, "fsr_rcas_attenuation=%f", &f) == 1) {
presenter->GetFsrSettingsRef().rcas_attenuation = f;
}
}
void SerializeOptionsConfig(ImGuiTextBuffer* buf) {
buf->appendf("disassembler_cli_isa=%s\n", Options.disassembler_cli_isa.c_str());
buf->appendf("disassembler_cli_spv=%s\n", Options.disassembler_cli_spv.c_str());
buf->appendf("frame_dump_render_on_collapse=%d\n", Options.frame_dump_render_on_collapse);
buf->appendf("fsr_enabled=%d\n", presenter->GetFsrSettingsRef().enable);
buf->appendf("fsr_rcas_enabled=%d\n", presenter->GetFsrSettingsRef().use_rcas);
buf->appendf("fsr_rcas_attenuation=%f\n", presenter->GetFsrSettingsRef().rcas_attenuation);
}
} // namespace Core::Devtools