more settings conversion

This commit is contained in:
georgemoralis
2025-11-27 21:04:46 +02:00
parent d39ff10747
commit 6ee0ee65ad
7 changed files with 20 additions and 38 deletions

View File

@@ -180,8 +180,6 @@ static ConfigEntry<bool> vkGuestMarkers(false);
static ConfigEntry<bool> rdocEnable(false);
// Debug
static ConfigEntry<bool> isDebugDump(false);
static ConfigEntry<bool> isShaderDebug(false);
static ConfigEntry<bool> isFpsColor(true);
static ConfigEntry<bool> logEnabled(true);
@@ -340,14 +338,6 @@ bool getIsMotionControlsEnabled() {
return isMotionControlsEnabled.get();
}
bool debugDump() {
return isDebugDump.get();
}
bool collectShadersForDebug() {
return isShaderDebug.get();
}
bool nullGpu() {
return isNullGpu.get();
}
@@ -455,18 +445,10 @@ void setInternalScreenHeight(u32 height) {
internalScreenHeight.base_value = height;
}
void setDebugDump(bool enable, bool is_game_specific) {
isDebugDump.set(enable, is_game_specific);
}
void setLoggingEnabled(bool enable, bool is_game_specific) {
logEnabled.set(enable, is_game_specific);
}
void setCollectShaderForDebug(bool enable, bool is_game_specific) {
isShaderDebug.set(enable, is_game_specific);
}
void setNullGpu(bool enable, bool is_game_specific) {
isNullGpu.set(enable, is_game_specific);
}
@@ -727,8 +709,6 @@ void load(const std::filesystem::path& path, bool is_game_specific) {
if (data.contains("Debug")) {
const toml::value& debug = data.at("Debug");
isDebugDump.setFromToml(debug, "DebugDump", is_game_specific);
isShaderDebug.setFromToml(debug, "CollectShader", is_game_specific);
isFpsColor.setFromToml(debug, "FPSColor", is_game_specific);
logEnabled.setFromToml(debug, "logEnabled", is_game_specific);
current_version = toml::find_or<std::string>(debug, "ConfigVersion", current_version);
@@ -871,8 +851,6 @@ void save(const std::filesystem::path& path, bool is_game_specific) {
vkGuestMarkers.setTomlValue(data, "Vulkan", "guestMarkers", is_game_specific);
rdocEnable.setTomlValue(data, "Vulkan", "rdocEnable", is_game_specific);
isDebugDump.setTomlValue(data, "Debug", "DebugDump", is_game_specific);
isShaderDebug.setTomlValue(data, "Debug", "CollectShader", is_game_specific);
logEnabled.setTomlValue(data, "Debug", "logEnabled", is_game_specific);
m_language.setTomlValue(data, "Settings", "consoleLanguage", is_game_specific);
@@ -985,8 +963,6 @@ void setDefaultValues(bool is_game_specific) {
rdocEnable.set(false, is_game_specific);
// GS - Debug
isDebugDump.set(false, is_game_specific);
isShaderDebug.set(false, is_game_specific);
logEnabled.set(true, is_game_specific);
// GS - Settings

View File

@@ -47,14 +47,10 @@ u32 getInternalScreenWidth();
u32 getInternalScreenHeight();
void setInternalScreenWidth(u32 width);
void setInternalScreenHeight(u32 height);
bool debugDump();
void setDebugDump(bool enable, bool is_game_specific = false);
s32 getGpuId();
void setGpuId(s32 selectedGpuId, bool is_game_specific = false);
bool allowHDR();
void setAllowHDR(bool enable, bool is_game_specific = false);
bool collectShadersForDebug();
void setCollectShaderForDebug(bool enable, bool is_game_specific = false);
bool nullGpu();
void setNullGpu(bool enable, bool is_game_specific = false);
bool copyGPUCmdBuffers();

View File

@@ -13,6 +13,7 @@
#include "common/string_util.h"
#include "core/debug_state.h"
#include "core/devtools/options.h"
#include "core/emulator_settings.h"
#include "imgui/imgui_std.h"
#include "sdl_window.h"
#include "video_core/renderer_vulkan/vk_presenter.h"
@@ -244,8 +245,8 @@ void ShaderList::Draw() {
return;
}
if (!Config::collectShadersForDebug()) {
DrawCenteredText("Enable 'CollectShader' in config to see shaders");
if (!EmulatorSettings::GetInstance()->IsShaderDump()) {
DrawCenteredText("Enable 'shader_dump' in config to see shaders");
End();
return;
}

View File

@@ -78,6 +78,10 @@ std::vector<std::filesystem::path> EmulatorSettings::GetGameInstallDirs() const
return out;
}
const std::vector<GameInstallDir>& EmulatorSettings::GetAllGameInstallDirs() const {
return m_general.install_dirs.value;
}
void EmulatorSettings::SetAllGameInstallDirs(const std::vector<GameInstallDir>& dirs) {
m_general.install_dirs.value = dirs;
}

View File

@@ -130,21 +130,21 @@ NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(GeneralSettings, install_dirs, addon_install_
struct DebugSettings {
Setting<bool> separate_logging_enabled{false}; // specific
Setting<bool> debug_dump{false}; // specific
Setting<bool> shader_debug{false}; // specific
Setting<bool> shader_dump{false}; // specific
Setting<bool> fps_color{true};
Setting<bool> log_enabled{true}; // specific
std::vector<OverrideItem> GetOverrideableFields() const {
return std::vector<OverrideItem>{
make_override<DebugSettings>("debug_dump", &DebugSettings::debug_dump),
make_override<DebugSettings>("shader_debug", &DebugSettings::shader_debug),
make_override<DebugSettings>("shader_dump", &DebugSettings::shader_dump),
make_override<DebugSettings>("separate_logging_enabled",
&DebugSettings::separate_logging_enabled),
make_override<DebugSettings>("log_enabled", &DebugSettings::log_enabled)};
}
};
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(DebugSettings, separate_logging_enabled, debug_dump,
shader_debug, fps_color, log_enabled)
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(DebugSettings, separate_logging_enabled, debug_dump, shader_dump,
fps_color, log_enabled)
// -------------------------------
// Input settings
@@ -268,6 +268,7 @@ public:
void SetGameInstallDirEnabled(const std::filesystem::path& dir, bool enabled);
void SetGameInstallDirs(const std::vector<std::filesystem::path>& dirs_config);
const std::vector<bool> GetGameInstallDirsEnabled();
const std::vector<GameInstallDir>& GetAllGameInstallDirs() const;
std::filesystem::path GetHomeDir();
void SetHomeDir(const std::filesystem::path& dir);
@@ -340,6 +341,8 @@ public:
// Debug settings
SETTING_FORWARD_BOOL(m_debug, SeparateLoggingEnabled, separate_logging_enabled)
SETTING_FORWARD_BOOL(m_debug, DebugDump, debug_dump)
SETTING_FORWARD_BOOL(m_debug, ShaderDump, shader_dump)
#undef SETTING_FORWARD
#undef SETTING_FORWARD_BOOL

View File

@@ -13,6 +13,7 @@
#include "core/aerolib/aerolib.h"
#include "core/aerolib/stubs.h"
#include "core/devtools/widget/module_list.h"
#include "core/emulator_settings.h"
#include "core/libraries/kernel/kernel.h"
#include "core/libraries/kernel/memory.h"
#include "core/libraries/kernel/threads.h"
@@ -56,7 +57,7 @@ Linker::Linker() : memory{Memory::Instance()} {}
Linker::~Linker() = default;
void Linker::Execute(const std::vector<std::string>& args) {
if (Config::debugDump()) {
if (EmulatorSettings::GetInstance()->IsDebugDump()) {
DebugDump();
}

View File

@@ -8,6 +8,7 @@
#include "common/io_file.h"
#include "common/path_util.h"
#include "core/debug_state.h"
#include "core/emulator_settings.h"
#include "shader_recompiler/backend/spirv/emit_spirv.h"
#include "shader_recompiler/info.h"
#include "shader_recompiler/recompiler.h"
@@ -286,7 +287,7 @@ const GraphicsPipeline* PipelineCache::GetGraphicsPipeline() {
it.value() = std::make_unique<GraphicsPipeline>(instance, scheduler, desc_heap, profile,
graphics_key, *pipeline_cache, infos,
runtime_infos, fetch_shader, modules);
if (Config::collectShadersForDebug()) {
if (EmulatorSettings::GetInstance()->IsShaderDump()) {
for (auto stage = 0; stage < MaxShaderStages; ++stage) {
if (infos[stage]) {
auto& m = modules[stage];
@@ -310,7 +311,7 @@ const ComputePipeline* PipelineCache::GetComputePipeline() {
it.value() =
std::make_unique<ComputePipeline>(instance, scheduler, desc_heap, profile,
*pipeline_cache, compute_key, *infos[0], modules[0]);
if (Config::collectShadersForDebug()) {
if (EmulatorSettings::GetInstance()->IsShaderDump()) {
auto& m = modules[0];
module_related_pipelines[m].emplace_back(compute_key);
}
@@ -538,7 +539,7 @@ vk::ShaderModule PipelineCache::CompileModule(Shader::Info& info, Shader::Runtim
const auto name = GetShaderName(info.stage, info.pgm_hash, perm_idx);
Vulkan::SetObjectName(instance.GetDevice(), module, name);
if (Config::collectShadersForDebug()) {
if (EmulatorSettings::GetInstance()->IsShaderDump()) {
DebugState.CollectShader(name, info.l_stage, module, spv, code,
patch ? *patch : std::span<const u32>{}, is_patched);
}