diff options
Diffstat (limited to 'src/common')
| -rw-r--r-- | src/common/cache_management.cpp | 5 | ||||
| -rw-r--r-- | src/common/cache_management.h | 2 | ||||
| -rw-r--r-- | src/common/input.h | 40 | ||||
| -rw-r--r-- | src/common/settings.cpp | 2 | ||||
| -rw-r--r-- | src/common/settings.h | 3 |
5 files changed, 44 insertions, 8 deletions
diff --git a/src/common/cache_management.cpp b/src/common/cache_management.cpp index 57810b76a..ed353828a 100644 --- a/src/common/cache_management.cpp +++ b/src/common/cache_management.cpp | |||
| @@ -1,11 +1,10 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project | 1 | // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #include <cstdint> | ||
| 4 | #include <cstring> | 5 | #include <cstring> |
| 5 | 6 | ||
| 6 | #include "alignment.h" | 7 | #include "common/cache_management.h" |
| 7 | #include "cache_management.h" | ||
| 8 | #include "common_types.h" | ||
| 9 | 8 | ||
| 10 | namespace Common { | 9 | namespace Common { |
| 11 | 10 | ||
diff --git a/src/common/cache_management.h b/src/common/cache_management.h index e467b87e4..038323e95 100644 --- a/src/common/cache_management.h +++ b/src/common/cache_management.h | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | #pragma once | 4 | #pragma once |
| 5 | 5 | ||
| 6 | #include "stdlib.h" | 6 | #include <cstddef> |
| 7 | 7 | ||
| 8 | namespace Common { | 8 | namespace Common { |
| 9 | 9 | ||
diff --git a/src/common/input.h b/src/common/input.h index cb30b7254..449e0193f 100644 --- a/src/common/input.h +++ b/src/common/input.h | |||
| @@ -383,6 +383,16 @@ void RegisterFactory(const std::string& name, std::shared_ptr<Factory<InputDevic | |||
| 383 | } | 383 | } |
| 384 | } | 384 | } |
| 385 | 385 | ||
| 386 | inline void RegisterInputFactory(const std::string& name, | ||
| 387 | std::shared_ptr<Factory<InputDevice>> factory) { | ||
| 388 | RegisterFactory<InputDevice>(name, std::move(factory)); | ||
| 389 | } | ||
| 390 | |||
| 391 | inline void RegisterOutputFactory(const std::string& name, | ||
| 392 | std::shared_ptr<Factory<OutputDevice>> factory) { | ||
| 393 | RegisterFactory<OutputDevice>(name, std::move(factory)); | ||
| 394 | } | ||
| 395 | |||
| 386 | /** | 396 | /** |
| 387 | * Unregisters an input device factory. | 397 | * Unregisters an input device factory. |
| 388 | * @tparam InputDeviceType the type of input devices the factory can create | 398 | * @tparam InputDeviceType the type of input devices the factory can create |
| @@ -395,6 +405,14 @@ void UnregisterFactory(const std::string& name) { | |||
| 395 | } | 405 | } |
| 396 | } | 406 | } |
| 397 | 407 | ||
| 408 | inline void UnregisterInputFactory(const std::string& name) { | ||
| 409 | UnregisterFactory<InputDevice>(name); | ||
| 410 | } | ||
| 411 | |||
| 412 | inline void UnregisterOutputFactory(const std::string& name) { | ||
| 413 | UnregisterFactory<OutputDevice>(name); | ||
| 414 | } | ||
| 415 | |||
| 398 | /** | 416 | /** |
| 399 | * Create an input device from given paramters. | 417 | * Create an input device from given paramters. |
| 400 | * @tparam InputDeviceType the type of input devices to create | 418 | * @tparam InputDeviceType the type of input devices to create |
| @@ -416,13 +434,21 @@ std::unique_ptr<InputDeviceType> CreateDeviceFromString(const std::string& param | |||
| 416 | return pair->second->Create(package); | 434 | return pair->second->Create(package); |
| 417 | } | 435 | } |
| 418 | 436 | ||
| 437 | inline std::unique_ptr<InputDevice> CreateInputDeviceFromString(const std::string& params) { | ||
| 438 | return CreateDeviceFromString<InputDevice>(params); | ||
| 439 | } | ||
| 440 | |||
| 441 | inline std::unique_ptr<OutputDevice> CreateOutputDeviceFromString(const std::string& params) { | ||
| 442 | return CreateDeviceFromString<OutputDevice>(params); | ||
| 443 | } | ||
| 444 | |||
| 419 | /** | 445 | /** |
| 420 | * Create an input device from given paramters. | 446 | * Create an input device from given parameters. |
| 421 | * @tparam InputDeviceType the type of input devices to create | 447 | * @tparam InputDeviceType the type of input devices to create |
| 422 | * @param A ParamPackage that contains all parameters for creating the device | 448 | * @param package A ParamPackage that contains all parameters for creating the device |
| 423 | */ | 449 | */ |
| 424 | template <typename InputDeviceType> | 450 | template <typename InputDeviceType> |
| 425 | std::unique_ptr<InputDeviceType> CreateDevice(const Common::ParamPackage package) { | 451 | std::unique_ptr<InputDeviceType> CreateDevice(const ParamPackage& package) { |
| 426 | const std::string engine = package.Get("engine", "null"); | 452 | const std::string engine = package.Get("engine", "null"); |
| 427 | const auto& factory_list = Impl::FactoryList<InputDeviceType>::list; | 453 | const auto& factory_list = Impl::FactoryList<InputDeviceType>::list; |
| 428 | const auto pair = factory_list.find(engine); | 454 | const auto pair = factory_list.find(engine); |
| @@ -435,4 +461,12 @@ std::unique_ptr<InputDeviceType> CreateDevice(const Common::ParamPackage package | |||
| 435 | return pair->second->Create(package); | 461 | return pair->second->Create(package); |
| 436 | } | 462 | } |
| 437 | 463 | ||
| 464 | inline std::unique_ptr<InputDevice> CreateInputDevice(const ParamPackage& package) { | ||
| 465 | return CreateDevice<InputDevice>(package); | ||
| 466 | } | ||
| 467 | |||
| 468 | inline std::unique_ptr<OutputDevice> CreateOutputDevice(const ParamPackage& package) { | ||
| 469 | return CreateDevice<OutputDevice>(package); | ||
| 470 | } | ||
| 471 | |||
| 438 | } // namespace Common::Input | 472 | } // namespace Common::Input |
diff --git a/src/common/settings.cpp b/src/common/settings.cpp index 8173462cb..d8ffe34c3 100644 --- a/src/common/settings.cpp +++ b/src/common/settings.cpp | |||
| @@ -48,6 +48,7 @@ void LogSettings() { | |||
| 48 | log_setting("CPU_Accuracy", values.cpu_accuracy.GetValue()); | 48 | log_setting("CPU_Accuracy", values.cpu_accuracy.GetValue()); |
| 49 | log_setting("Renderer_UseResolutionScaling", values.resolution_setup.GetValue()); | 49 | log_setting("Renderer_UseResolutionScaling", values.resolution_setup.GetValue()); |
| 50 | log_setting("Renderer_ScalingFilter", values.scaling_filter.GetValue()); | 50 | log_setting("Renderer_ScalingFilter", values.scaling_filter.GetValue()); |
| 51 | log_setting("Renderer_FSRSlider", values.fsr_sharpening_slider.GetValue()); | ||
| 51 | log_setting("Renderer_AntiAliasing", values.anti_aliasing.GetValue()); | 52 | log_setting("Renderer_AntiAliasing", values.anti_aliasing.GetValue()); |
| 52 | log_setting("Renderer_UseSpeedLimit", values.use_speed_limit.GetValue()); | 53 | log_setting("Renderer_UseSpeedLimit", values.use_speed_limit.GetValue()); |
| 53 | log_setting("Renderer_SpeedLimit", values.speed_limit.GetValue()); | 54 | log_setting("Renderer_SpeedLimit", values.speed_limit.GetValue()); |
| @@ -181,6 +182,7 @@ void RestoreGlobalState(bool is_powered_on) { | |||
| 181 | values.cpuopt_unsafe_ignore_global_monitor.SetGlobal(true); | 182 | values.cpuopt_unsafe_ignore_global_monitor.SetGlobal(true); |
| 182 | 183 | ||
| 183 | // Renderer | 184 | // Renderer |
| 185 | values.fsr_sharpening_slider.SetGlobal(true); | ||
| 184 | values.renderer_backend.SetGlobal(true); | 186 | values.renderer_backend.SetGlobal(true); |
| 185 | values.vulkan_device.SetGlobal(true); | 187 | values.vulkan_device.SetGlobal(true); |
| 186 | values.aspect_ratio.SetGlobal(true); | 188 | values.aspect_ratio.SetGlobal(true); |
diff --git a/src/common/settings.h b/src/common/settings.h index 0eb98939c..00e4421f7 100644 --- a/src/common/settings.h +++ b/src/common/settings.h | |||
| @@ -421,6 +421,7 @@ struct Values { | |||
| 421 | ResolutionScalingInfo resolution_info{}; | 421 | ResolutionScalingInfo resolution_info{}; |
| 422 | SwitchableSetting<ResolutionSetup> resolution_setup{ResolutionSetup::Res1X, "resolution_setup"}; | 422 | SwitchableSetting<ResolutionSetup> resolution_setup{ResolutionSetup::Res1X, "resolution_setup"}; |
| 423 | SwitchableSetting<ScalingFilter> scaling_filter{ScalingFilter::Bilinear, "scaling_filter"}; | 423 | SwitchableSetting<ScalingFilter> scaling_filter{ScalingFilter::Bilinear, "scaling_filter"}; |
| 424 | SwitchableSetting<int, true> fsr_sharpening_slider{25, 0, 200, "fsr_sharpening_slider"}; | ||
| 424 | SwitchableSetting<AntiAliasing> anti_aliasing{AntiAliasing::None, "anti_aliasing"}; | 425 | SwitchableSetting<AntiAliasing> anti_aliasing{AntiAliasing::None, "anti_aliasing"}; |
| 425 | // *nix platforms may have issues with the borderless windowed fullscreen mode. | 426 | // *nix platforms may have issues with the borderless windowed fullscreen mode. |
| 426 | // Default to exclusive fullscreen on these platforms for now. | 427 | // Default to exclusive fullscreen on these platforms for now. |
| @@ -442,7 +443,7 @@ struct Values { | |||
| 442 | SwitchableSetting<NvdecEmulation> nvdec_emulation{NvdecEmulation::GPU, "nvdec_emulation"}; | 443 | SwitchableSetting<NvdecEmulation> nvdec_emulation{NvdecEmulation::GPU, "nvdec_emulation"}; |
| 443 | SwitchableSetting<bool> accelerate_astc{true, "accelerate_astc"}; | 444 | SwitchableSetting<bool> accelerate_astc{true, "accelerate_astc"}; |
| 444 | SwitchableSetting<bool> use_vsync{true, "use_vsync"}; | 445 | SwitchableSetting<bool> use_vsync{true, "use_vsync"}; |
| 445 | SwitchableSetting<ShaderBackend, true> shader_backend{ShaderBackend::GLASM, ShaderBackend::GLSL, | 446 | SwitchableSetting<ShaderBackend, true> shader_backend{ShaderBackend::GLSL, ShaderBackend::GLSL, |
| 446 | ShaderBackend::SPIRV, "shader_backend"}; | 447 | ShaderBackend::SPIRV, "shader_backend"}; |
| 447 | SwitchableSetting<bool> use_asynchronous_shaders{false, "use_asynchronous_shaders"}; | 448 | SwitchableSetting<bool> use_asynchronous_shaders{false, "use_asynchronous_shaders"}; |
| 448 | SwitchableSetting<bool> use_fast_gpu_time{true, "use_fast_gpu_time"}; | 449 | SwitchableSetting<bool> use_fast_gpu_time{true, "use_fast_gpu_time"}; |