2
1
Fork 0
mirror of https://github.com/yuzu-emu/yuzu.git synced 2024-07-04 23:31:19 +01:00

settings: Define base renderer runtime modifiable settings

This commit is contained in:
lat9nq 2023-05-08 10:03:40 -04:00
parent 05c26411a3
commit 3a7a5edcea
2 changed files with 27 additions and 25 deletions

View file

@ -701,32 +701,33 @@ struct Values {
ResolutionScalingInfo resolution_info{}; ResolutionScalingInfo resolution_info{};
SwitchableSetting<ResolutionSetup> resolution_setup{linkage, ResolutionSetup::Res1X, SwitchableSetting<ResolutionSetup> resolution_setup{linkage, ResolutionSetup::Res1X,
"resolution_setup", Category::Renderer}; "resolution_setup", Category::Renderer};
SwitchableSetting<ScalingFilter> scaling_filter{linkage, ScalingFilter::Bilinear, SwitchableSetting<ScalingFilter, false, true, true> scaling_filter{
"scaling_filter", Category::Renderer}; linkage, ScalingFilter::Bilinear, "scaling_filter", Category::Renderer};
SwitchableSetting<int, true> fsr_sharpening_slider{ SwitchableSetting<int, true, true, true> fsr_sharpening_slider{
linkage, 25, 0, 200, "fsr_sharpening_slider", Category::Renderer}; linkage, 25, 0, 200, "fsr_sharpening_slider", Category::Renderer};
SwitchableSetting<AntiAliasing> anti_aliasing{linkage, AntiAliasing::None, "anti_aliasing", SwitchableSetting<AntiAliasing, false, true, true> anti_aliasing{
Category::Renderer}; linkage, AntiAliasing::None, "anti_aliasing", Category::Renderer};
// *nix platforms may have issues with the borderless windowed fullscreen mode. // *nix platforms may have issues with the borderless windowed fullscreen mode.
// Default to exclusive fullscreen on these platforms for now. // Default to exclusive fullscreen on these platforms for now.
SwitchableSetting<FullscreenMode, true> fullscreen_mode{linkage, SwitchableSetting<FullscreenMode, true, true, true> fullscreen_mode{linkage,
#ifdef _WIN32 #ifdef _WIN32
FullscreenMode::Borderless, FullscreenMode::Borderless,
#else #else
FullscreenMode::Exclusive, FullscreenMode::Exclusive,
#endif #endif
FullscreenMode::Borderless, FullscreenMode::Borderless,
FullscreenMode::Exclusive, FullscreenMode::Exclusive,
"fullscreen_mode", "fullscreen_mode",
Category::Renderer}; Category::Renderer};
SwitchableSetting<int, true> aspect_ratio{linkage, 0, 0, 4, "aspect_ratio", Category::Renderer}; SwitchableSetting<int, true, true, true> aspect_ratio{
linkage, 0, 0, 4, "aspect_ratio", Category::Renderer};
SwitchableSetting<AnisotropyMode, true> max_anisotropy{ SwitchableSetting<AnisotropyMode, true> max_anisotropy{
linkage, AnisotropyMode::Automatic, AnisotropyMode::Automatic, AnisotropyMode::X16, linkage, AnisotropyMode::Automatic, AnisotropyMode::Automatic, AnisotropyMode::X16,
"max_anisotropy", Category::RendererAdvanced}; "max_anisotropy", Category::RendererAdvanced};
SwitchableSetting<bool, false, false> use_speed_limit{linkage, true, "use_speed_limit", SwitchableSetting<bool, false, false, true> use_speed_limit{linkage, true, "use_speed_limit",
Category::Renderer}; Category::Renderer};
SwitchableSetting<u16, true> speed_limit{linkage, 100, 0, SwitchableSetting<u16, true, true, true> speed_limit{
9999, "speed_limit", Category::Renderer}; linkage, 100, 0, 9999, "speed_limit", Category::Renderer};
SwitchableSetting<bool> use_disk_shader_cache{linkage, true, "use_disk_shader_cache", SwitchableSetting<bool> use_disk_shader_cache{linkage, true, "use_disk_shader_cache",
Category::Renderer}; Category::Renderer};
SwitchableSetting<GPUAccuracy, true, true, true> gpu_accuracy{ SwitchableSetting<GPUAccuracy, true, true, true> gpu_accuracy{
@ -742,7 +743,7 @@ struct Values {
AstcDecodeMode::CPUAsynchronous, AstcDecodeMode::CPUAsynchronous,
"accelerate_astc", "accelerate_astc",
Category::Renderer}; Category::Renderer};
Setting<VSyncMode, true> vsync_mode{ Setting<VSyncMode, true, true, true> vsync_mode{
linkage, VSyncMode::FIFO, VSyncMode::Immediate, VSyncMode::FIFORelaxed, linkage, VSyncMode::FIFO, VSyncMode::Immediate, VSyncMode::FIFORelaxed,
"use_vsync", Category::Renderer}; "use_vsync", Category::Renderer};
SwitchableSetting<bool> use_reactive_flushing{linkage, true, "use_reactive_flushing", SwitchableSetting<bool> use_reactive_flushing{linkage, true, "use_reactive_flushing",
@ -769,9 +770,9 @@ struct Values {
SwitchableSetting<bool> barrier_feedback_loops{linkage, true, "barrier_feedback_loops", SwitchableSetting<bool> barrier_feedback_loops{linkage, true, "barrier_feedback_loops",
Category::RendererAdvanced}; Category::RendererAdvanced};
SwitchableSetting<u8> bg_red{linkage, 0, "bg_red", Category::Renderer}; SwitchableSetting<u8, false, true, true> bg_red{linkage, 0, "bg_red", Category::Renderer};
SwitchableSetting<u8> bg_green{linkage, 0, "bg_green", Category::Renderer}; SwitchableSetting<u8, false, true, true> bg_green{linkage, 0, "bg_green", Category::Renderer};
SwitchableSetting<u8> bg_blue{linkage, 0, "bg_blue", Category::Renderer}; SwitchableSetting<u8, false, true, true> bg_blue{linkage, 0, "bg_blue", Category::Renderer};
// System // System
SwitchableSetting<bool> rng_seed_enabled{linkage, false, "rng_seed_enabled", Category::System}; SwitchableSetting<bool> rng_seed_enabled{linkage, false, "rng_seed_enabled", Category::System};

View file

@ -92,10 +92,11 @@ void SetPerGameSetting(QComboBox* combobox,
void SetHighlight(QWidget* widget, bool highlighted); void SetHighlight(QWidget* widget, bool highlighted);
// Sets up a QCheckBox like a tristate one, given a Setting // Sets up a QCheckBox like a tristate one, given a Setting
template <bool ranged, bool save> template <bool ranged, bool save, bool runtime_modifiable>
void SetColoredTristate(QCheckBox* checkbox, void SetColoredTristate(
const Settings::SwitchableSetting<bool, ranged, save>& setting, QCheckBox* checkbox,
CheckState& tracker) { const Settings::SwitchableSetting<bool, ranged, save, runtime_modifiable>& setting,
CheckState& tracker) {
if (setting.UsingGlobal()) { if (setting.UsingGlobal()) {
tracker = CheckState::Global; tracker = CheckState::Global;
} else { } else {