diff options
Diffstat (limited to 'src/common')
| -rw-r--r-- | src/common/CMakeLists.txt | 4 | ||||
| -rw-r--r-- | src/common/demangle.cpp | 37 | ||||
| -rw-r--r-- | src/common/demangle.h | 12 | ||||
| -rw-r--r-- | src/common/input.h | 3 | ||||
| -rw-r--r-- | src/common/settings.cpp | 14 | ||||
| -rw-r--r-- | src/common/settings.h | 16 |
6 files changed, 77 insertions, 9 deletions
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 45332cf95..bd6ac6716 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt | |||
| @@ -38,6 +38,8 @@ add_library(common STATIC | |||
| 38 | common_precompiled_headers.h | 38 | common_precompiled_headers.h |
| 39 | common_types.h | 39 | common_types.h |
| 40 | concepts.h | 40 | concepts.h |
| 41 | demangle.cpp | ||
| 42 | demangle.h | ||
| 41 | div_ceil.h | 43 | div_ceil.h |
| 42 | dynamic_library.cpp | 44 | dynamic_library.cpp |
| 43 | dynamic_library.h | 45 | dynamic_library.h |
| @@ -175,7 +177,7 @@ endif() | |||
| 175 | create_target_directory_groups(common) | 177 | create_target_directory_groups(common) |
| 176 | 178 | ||
| 177 | target_link_libraries(common PUBLIC ${Boost_LIBRARIES} fmt::fmt microprofile Threads::Threads) | 179 | target_link_libraries(common PUBLIC ${Boost_LIBRARIES} fmt::fmt microprofile Threads::Threads) |
| 178 | target_link_libraries(common PRIVATE lz4::lz4 zstd::zstd) | 180 | target_link_libraries(common PRIVATE lz4::lz4 zstd::zstd demangle) |
| 179 | 181 | ||
| 180 | if (YUZU_USE_PRECOMPILED_HEADERS) | 182 | if (YUZU_USE_PRECOMPILED_HEADERS) |
| 181 | target_precompile_headers(common PRIVATE precompiled_headers.h) | 183 | target_precompile_headers(common PRIVATE precompiled_headers.h) |
diff --git a/src/common/demangle.cpp b/src/common/demangle.cpp new file mode 100644 index 000000000..f4246f666 --- /dev/null +++ b/src/common/demangle.cpp | |||
| @@ -0,0 +1,37 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project | ||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
| 3 | |||
| 4 | #include "common/demangle.h" | ||
| 5 | #include "common/scope_exit.h" | ||
| 6 | |||
| 7 | namespace llvm { | ||
| 8 | char* itaniumDemangle(const char* mangled_name, char* buf, size_t* n, int* status); | ||
| 9 | } | ||
| 10 | |||
| 11 | namespace Common { | ||
| 12 | |||
| 13 | std::string DemangleSymbol(const std::string& mangled) { | ||
| 14 | auto is_itanium = [](const std::string& name) -> bool { | ||
| 15 | // A valid Itanium encoding requires 1-4 leading underscores, followed by 'Z'. | ||
| 16 | auto pos = name.find_first_not_of('_'); | ||
| 17 | return pos > 0 && pos <= 4 && pos < name.size() && name[pos] == 'Z'; | ||
| 18 | }; | ||
| 19 | |||
| 20 | if (mangled.empty()) { | ||
| 21 | return mangled; | ||
| 22 | } | ||
| 23 | |||
| 24 | char* demangled = nullptr; | ||
| 25 | SCOPE_EXIT({ std::free(demangled); }); | ||
| 26 | |||
| 27 | if (is_itanium(mangled)) { | ||
| 28 | demangled = llvm::itaniumDemangle(mangled.c_str(), nullptr, nullptr, nullptr); | ||
| 29 | } | ||
| 30 | |||
| 31 | if (!demangled) { | ||
| 32 | return mangled; | ||
| 33 | } | ||
| 34 | return demangled; | ||
| 35 | } | ||
| 36 | |||
| 37 | } // namespace Common | ||
diff --git a/src/common/demangle.h b/src/common/demangle.h new file mode 100644 index 000000000..f072d22f3 --- /dev/null +++ b/src/common/demangle.h | |||
| @@ -0,0 +1,12 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project | ||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
| 3 | |||
| 4 | #pragma once | ||
| 5 | |||
| 6 | #include <string> | ||
| 7 | |||
| 8 | namespace Common { | ||
| 9 | |||
| 10 | std::string DemangleSymbol(const std::string& mangled); | ||
| 11 | |||
| 12 | } // namespace Common | ||
diff --git a/src/common/input.h b/src/common/input.h index fc14fd7bf..d27b1d772 100644 --- a/src/common/input.h +++ b/src/common/input.h | |||
| @@ -292,9 +292,6 @@ class InputDevice { | |||
| 292 | public: | 292 | public: |
| 293 | virtual ~InputDevice() = default; | 293 | virtual ~InputDevice() = default; |
| 294 | 294 | ||
| 295 | // Request input device to update if necessary | ||
| 296 | virtual void SoftUpdate() {} | ||
| 297 | |||
| 298 | // Force input device to update data regardless of the current state | 295 | // Force input device to update data regardless of the current state |
| 299 | virtual void ForceUpdate() {} | 296 | virtual void ForceUpdate() {} |
| 300 | 297 | ||
diff --git a/src/common/settings.cpp b/src/common/settings.cpp index 149e621f9..b1a2aa8b2 100644 --- a/src/common/settings.cpp +++ b/src/common/settings.cpp | |||
| @@ -129,6 +129,10 @@ void UpdateRescalingInfo() { | |||
| 129 | info.up_scale = 1; | 129 | info.up_scale = 1; |
| 130 | info.down_shift = 0; | 130 | info.down_shift = 0; |
| 131 | break; | 131 | break; |
| 132 | case ResolutionSetup::Res3_2X: | ||
| 133 | info.up_scale = 3; | ||
| 134 | info.down_shift = 1; | ||
| 135 | break; | ||
| 132 | case ResolutionSetup::Res2X: | 136 | case ResolutionSetup::Res2X: |
| 133 | info.up_scale = 2; | 137 | info.up_scale = 2; |
| 134 | info.down_shift = 0; | 138 | info.down_shift = 0; |
| @@ -149,6 +153,14 @@ void UpdateRescalingInfo() { | |||
| 149 | info.up_scale = 6; | 153 | info.up_scale = 6; |
| 150 | info.down_shift = 0; | 154 | info.down_shift = 0; |
| 151 | break; | 155 | break; |
| 156 | case ResolutionSetup::Res7X: | ||
| 157 | info.up_scale = 7; | ||
| 158 | info.down_shift = 0; | ||
| 159 | break; | ||
| 160 | case ResolutionSetup::Res8X: | ||
| 161 | info.up_scale = 8; | ||
| 162 | info.down_shift = 0; | ||
| 163 | break; | ||
| 152 | default: | 164 | default: |
| 153 | ASSERT(false); | 165 | ASSERT(false); |
| 154 | info.up_scale = 1; | 166 | info.up_scale = 1; |
| @@ -185,6 +197,7 @@ void RestoreGlobalState(bool is_powered_on) { | |||
| 185 | // Renderer | 197 | // Renderer |
| 186 | values.fsr_sharpening_slider.SetGlobal(true); | 198 | values.fsr_sharpening_slider.SetGlobal(true); |
| 187 | values.renderer_backend.SetGlobal(true); | 199 | values.renderer_backend.SetGlobal(true); |
| 200 | values.renderer_force_max_clock.SetGlobal(true); | ||
| 188 | values.vulkan_device.SetGlobal(true); | 201 | values.vulkan_device.SetGlobal(true); |
| 189 | values.aspect_ratio.SetGlobal(true); | 202 | values.aspect_ratio.SetGlobal(true); |
| 190 | values.max_anisotropy.SetGlobal(true); | 203 | values.max_anisotropy.SetGlobal(true); |
| @@ -200,6 +213,7 @@ void RestoreGlobalState(bool is_powered_on) { | |||
| 200 | values.use_asynchronous_shaders.SetGlobal(true); | 213 | values.use_asynchronous_shaders.SetGlobal(true); |
| 201 | values.use_fast_gpu_time.SetGlobal(true); | 214 | values.use_fast_gpu_time.SetGlobal(true); |
| 202 | values.use_pessimistic_flushes.SetGlobal(true); | 215 | values.use_pessimistic_flushes.SetGlobal(true); |
| 216 | values.use_vulkan_driver_pipeline_cache.SetGlobal(true); | ||
| 203 | values.bg_red.SetGlobal(true); | 217 | values.bg_red.SetGlobal(true); |
| 204 | values.bg_green.SetGlobal(true); | 218 | values.bg_green.SetGlobal(true); |
| 205 | values.bg_blue.SetGlobal(true); | 219 | values.bg_blue.SetGlobal(true); |
diff --git a/src/common/settings.h b/src/common/settings.h index 5017951c5..80b2eeabc 100644 --- a/src/common/settings.h +++ b/src/common/settings.h | |||
| @@ -56,11 +56,14 @@ enum class ResolutionSetup : u32 { | |||
| 56 | Res1_2X = 0, | 56 | Res1_2X = 0, |
| 57 | Res3_4X = 1, | 57 | Res3_4X = 1, |
| 58 | Res1X = 2, | 58 | Res1X = 2, |
| 59 | Res2X = 3, | 59 | Res3_2X = 3, |
| 60 | Res3X = 4, | 60 | Res2X = 4, |
| 61 | Res4X = 5, | 61 | Res3X = 5, |
| 62 | Res5X = 6, | 62 | Res4X = 6, |
| 63 | Res6X = 7, | 63 | Res5X = 7, |
| 64 | Res6X = 8, | ||
| 65 | Res7X = 9, | ||
| 66 | Res8X = 10, | ||
| 64 | }; | 67 | }; |
| 65 | 68 | ||
| 66 | enum class ScalingFilter : u32 { | 69 | enum class ScalingFilter : u32 { |
| @@ -415,6 +418,7 @@ struct Values { | |||
| 415 | // Renderer | 418 | // Renderer |
| 416 | SwitchableSetting<RendererBackend, true> renderer_backend{ | 419 | SwitchableSetting<RendererBackend, true> renderer_backend{ |
| 417 | RendererBackend::Vulkan, RendererBackend::OpenGL, RendererBackend::Null, "backend"}; | 420 | RendererBackend::Vulkan, RendererBackend::OpenGL, RendererBackend::Null, "backend"}; |
| 421 | SwitchableSetting<bool> renderer_force_max_clock{false, "force_max_clock"}; | ||
| 418 | Setting<bool> renderer_debug{false, "debug"}; | 422 | Setting<bool> renderer_debug{false, "debug"}; |
| 419 | Setting<bool> renderer_shader_feedback{false, "shader_feedback"}; | 423 | Setting<bool> renderer_shader_feedback{false, "shader_feedback"}; |
| 420 | Setting<bool> enable_nsight_aftermath{false, "nsight_aftermath"}; | 424 | Setting<bool> enable_nsight_aftermath{false, "nsight_aftermath"}; |
| @@ -451,6 +455,8 @@ struct Values { | |||
| 451 | SwitchableSetting<bool> use_asynchronous_shaders{false, "use_asynchronous_shaders"}; | 455 | SwitchableSetting<bool> use_asynchronous_shaders{false, "use_asynchronous_shaders"}; |
| 452 | SwitchableSetting<bool> use_fast_gpu_time{true, "use_fast_gpu_time"}; | 456 | SwitchableSetting<bool> use_fast_gpu_time{true, "use_fast_gpu_time"}; |
| 453 | SwitchableSetting<bool> use_pessimistic_flushes{false, "use_pessimistic_flushes"}; | 457 | SwitchableSetting<bool> use_pessimistic_flushes{false, "use_pessimistic_flushes"}; |
| 458 | SwitchableSetting<bool> use_vulkan_driver_pipeline_cache{true, | ||
| 459 | "use_vulkan_driver_pipeline_cache"}; | ||
| 454 | 460 | ||
| 455 | SwitchableSetting<u8> bg_red{0, "bg_red"}; | 461 | SwitchableSetting<u8> bg_red{0, "bg_red"}; |
| 456 | SwitchableSetting<u8> bg_green{0, "bg_green"}; | 462 | SwitchableSetting<u8> bg_green{0, "bg_green"}; |