mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-05-14 08:12:16 +00:00
devtools: persist fsr configs (#2852)
Saves FSR config to imgui.ini so it won't reset every startup
This commit is contained in:
parent
410313ca87
commit
cef795b80b
4 changed files with 27 additions and 2 deletions
|
@ -1,11 +1,11 @@
|
||||||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
#include "SDL3/SDL_log.h"
|
|
||||||
#include "layer.h"
|
#include "layer.h"
|
||||||
|
|
||||||
#include <imgui.h>
|
#include <imgui.h>
|
||||||
|
|
||||||
|
#include "SDL3/SDL_log.h"
|
||||||
#include "common/config.h"
|
#include "common/config.h"
|
||||||
#include "common/singleton.h"
|
#include "common/singleton.h"
|
||||||
#include "common/types.h"
|
#include "common/types.h"
|
||||||
|
|
|
@ -1,9 +1,14 @@
|
||||||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
#include "options.h"
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
#include <imgui.h>
|
#include <imgui.h>
|
||||||
|
|
||||||
#include "options.h"
|
#include "video_core/renderer_vulkan/vk_presenter.h"
|
||||||
|
|
||||||
|
extern std::unique_ptr<Vulkan::Presenter> presenter;
|
||||||
|
|
||||||
namespace Core::Devtools {
|
namespace Core::Devtools {
|
||||||
|
|
||||||
|
@ -12,6 +17,7 @@ TOptions Options;
|
||||||
void LoadOptionsConfig(const char* line) {
|
void LoadOptionsConfig(const char* line) {
|
||||||
char str[512];
|
char str[512];
|
||||||
int i;
|
int i;
|
||||||
|
float f;
|
||||||
if (sscanf(line, "disassembler_cli_isa=%511[^\n]", str) == 1) {
|
if (sscanf(line, "disassembler_cli_isa=%511[^\n]", str) == 1) {
|
||||||
Options.disassembler_cli_isa = str;
|
Options.disassembler_cli_isa = str;
|
||||||
return;
|
return;
|
||||||
|
@ -24,12 +30,26 @@ void LoadOptionsConfig(const char* line) {
|
||||||
Options.frame_dump_render_on_collapse = i != 0;
|
Options.frame_dump_render_on_collapse = i != 0;
|
||||||
return;
|
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) {
|
void SerializeOptionsConfig(ImGuiTextBuffer* buf) {
|
||||||
buf->appendf("disassembler_cli_isa=%s\n", Options.disassembler_cli_isa.c_str());
|
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("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("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
|
} // namespace Core::Devtools
|
||||||
|
|
|
@ -4,8 +4,11 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
|
#include <vector>
|
||||||
#include <imgui.h>
|
#include <imgui.h>
|
||||||
|
|
||||||
|
#include "common/types.h"
|
||||||
|
|
||||||
namespace ImGui {
|
namespace ImGui {
|
||||||
|
|
||||||
namespace Core::TextureManager {
|
namespace Core::TextureManager {
|
||||||
|
|
|
@ -112,6 +112,8 @@ void Initialize(const ::Vulkan::Instance& instance, const Frontend::WindowSDL& w
|
||||||
if (const auto dpi = SDL_GetWindowDisplayScale(window.GetSDLWindow()); dpi > 0.0f) {
|
if (const auto dpi = SDL_GetWindowDisplayScale(window.GetSDLWindow()); dpi > 0.0f) {
|
||||||
GetIO().FontGlobalScale = dpi;
|
GetIO().FontGlobalScale = dpi;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::at_quick_exit([] { SaveIniSettingsToDisk(GetIO().IniFilename); });
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnResize() {
|
void OnResize() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue