summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/cache_management.cpp5
-rw-r--r--src/common/cache_management.h2
-rw-r--r--src/common/input.h40
-rw-r--r--src/common/settings.cpp2
-rw-r--r--src/common/settings.h3
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
10namespace Common { 9namespace 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
8namespace Common { 8namespace Common {
9 9
diff --git a/src/common/input.h b/src/common/input.h
index 9f7b89799..fc14fd7bf 100644
--- a/src/common/input.h
+++ b/src/common/input.h
@@ -384,6 +384,16 @@ void RegisterFactory(const std::string& name, std::shared_ptr<Factory<InputDevic
384 } 384 }
385} 385}
386 386
387inline void RegisterInputFactory(const std::string& name,
388 std::shared_ptr<Factory<InputDevice>> factory) {
389 RegisterFactory<InputDevice>(name, std::move(factory));
390}
391
392inline void RegisterOutputFactory(const std::string& name,
393 std::shared_ptr<Factory<OutputDevice>> factory) {
394 RegisterFactory<OutputDevice>(name, std::move(factory));
395}
396
387/** 397/**
388 * Unregisters an input device factory. 398 * Unregisters an input device factory.
389 * @tparam InputDeviceType the type of input devices the factory can create 399 * @tparam InputDeviceType the type of input devices the factory can create
@@ -396,6 +406,14 @@ void UnregisterFactory(const std::string& name) {
396 } 406 }
397} 407}
398 408
409inline void UnregisterInputFactory(const std::string& name) {
410 UnregisterFactory<InputDevice>(name);
411}
412
413inline void UnregisterOutputFactory(const std::string& name) {
414 UnregisterFactory<OutputDevice>(name);
415}
416
399/** 417/**
400 * Create an input device from given paramters. 418 * Create an input device from given paramters.
401 * @tparam InputDeviceType the type of input devices to create 419 * @tparam InputDeviceType the type of input devices to create
@@ -417,13 +435,21 @@ std::unique_ptr<InputDeviceType> CreateDeviceFromString(const std::string& param
417 return pair->second->Create(package); 435 return pair->second->Create(package);
418} 436}
419 437
438inline std::unique_ptr<InputDevice> CreateInputDeviceFromString(const std::string& params) {
439 return CreateDeviceFromString<InputDevice>(params);
440}
441
442inline std::unique_ptr<OutputDevice> CreateOutputDeviceFromString(const std::string& params) {
443 return CreateDeviceFromString<OutputDevice>(params);
444}
445
420/** 446/**
421 * Create an input device from given paramters. 447 * Create an input device from given parameters.
422 * @tparam InputDeviceType the type of input devices to create 448 * @tparam InputDeviceType the type of input devices to create
423 * @param A ParamPackage that contains all parameters for creating the device 449 * @param package A ParamPackage that contains all parameters for creating the device
424 */ 450 */
425template <typename InputDeviceType> 451template <typename InputDeviceType>
426std::unique_ptr<InputDeviceType> CreateDevice(const Common::ParamPackage package) { 452std::unique_ptr<InputDeviceType> CreateDevice(const ParamPackage& package) {
427 const std::string engine = package.Get("engine", "null"); 453 const std::string engine = package.Get("engine", "null");
428 const auto& factory_list = Impl::FactoryList<InputDeviceType>::list; 454 const auto& factory_list = Impl::FactoryList<InputDeviceType>::list;
429 const auto pair = factory_list.find(engine); 455 const auto pair = factory_list.find(engine);
@@ -436,4 +462,12 @@ std::unique_ptr<InputDeviceType> CreateDevice(const Common::ParamPackage package
436 return pair->second->Create(package); 462 return pair->second->Create(package);
437} 463}
438 464
465inline std::unique_ptr<InputDevice> CreateInputDevice(const ParamPackage& package) {
466 return CreateDevice<InputDevice>(package);
467}
468
469inline std::unique_ptr<OutputDevice> CreateOutputDevice(const ParamPackage& package) {
470 return CreateDevice<OutputDevice>(package);
471}
472
439} // namespace Common::Input 473} // 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"};