diff options
Diffstat (limited to 'src/common')
| -rw-r--r-- | src/common/CMakeLists.txt | 4 | ||||
| -rw-r--r-- | src/common/fs/path_util.cpp | 6 | ||||
| -rw-r--r-- | src/common/logging/filter.cpp | 2 | ||||
| -rw-r--r-- | src/common/logging/types.h | 2 | ||||
| -rw-r--r-- | src/common/polyfill_thread.h | 20 | ||||
| -rw-r--r-- | src/common/settings.h | 2 |
6 files changed, 25 insertions, 11 deletions
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 6d2badf76..34877b461 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt | |||
| @@ -151,6 +151,10 @@ add_library(common STATIC | |||
| 151 | zstd_compression.h | 151 | zstd_compression.h |
| 152 | ) | 152 | ) |
| 153 | 153 | ||
| 154 | if (YUZU_ENABLE_PORTABLE) | ||
| 155 | add_compile_definitions(YUZU_ENABLE_PORTABLE) | ||
| 156 | endif() | ||
| 157 | |||
| 154 | if (WIN32) | 158 | if (WIN32) |
| 155 | target_sources(common PRIVATE | 159 | target_sources(common PRIVATE |
| 156 | windows/timer_resolution.cpp | 160 | windows/timer_resolution.cpp |
diff --git a/src/common/fs/path_util.cpp b/src/common/fs/path_util.cpp index d71cfacc6..dce219fcf 100644 --- a/src/common/fs/path_util.cpp +++ b/src/common/fs/path_util.cpp | |||
| @@ -88,8 +88,9 @@ public: | |||
| 88 | fs::path yuzu_path_config; | 88 | fs::path yuzu_path_config; |
| 89 | 89 | ||
| 90 | #ifdef _WIN32 | 90 | #ifdef _WIN32 |
| 91 | #ifdef YUZU_ENABLE_PORTABLE | ||
| 91 | yuzu_path = GetExeDirectory() / PORTABLE_DIR; | 92 | yuzu_path = GetExeDirectory() / PORTABLE_DIR; |
| 92 | 93 | #endif | |
| 93 | if (!IsDir(yuzu_path)) { | 94 | if (!IsDir(yuzu_path)) { |
| 94 | yuzu_path = GetAppDataRoamingDirectory() / YUZU_DIR; | 95 | yuzu_path = GetAppDataRoamingDirectory() / YUZU_DIR; |
| 95 | } | 96 | } |
| @@ -101,8 +102,9 @@ public: | |||
| 101 | yuzu_path_cache = yuzu_path / CACHE_DIR; | 102 | yuzu_path_cache = yuzu_path / CACHE_DIR; |
| 102 | yuzu_path_config = yuzu_path / CONFIG_DIR; | 103 | yuzu_path_config = yuzu_path / CONFIG_DIR; |
| 103 | #else | 104 | #else |
| 105 | #ifdef YUZU_ENABLE_PORTABLE | ||
| 104 | yuzu_path = GetCurrentDir() / PORTABLE_DIR; | 106 | yuzu_path = GetCurrentDir() / PORTABLE_DIR; |
| 105 | 107 | #endif | |
| 106 | if (Exists(yuzu_path) && IsDir(yuzu_path)) { | 108 | if (Exists(yuzu_path) && IsDir(yuzu_path)) { |
| 107 | yuzu_path_cache = yuzu_path / CACHE_DIR; | 109 | yuzu_path_cache = yuzu_path / CACHE_DIR; |
| 108 | yuzu_path_config = yuzu_path / CONFIG_DIR; | 110 | yuzu_path_config = yuzu_path / CONFIG_DIR; |
diff --git a/src/common/logging/filter.cpp b/src/common/logging/filter.cpp index c95909561..4e3a614a4 100644 --- a/src/common/logging/filter.cpp +++ b/src/common/logging/filter.cpp | |||
| @@ -112,7 +112,7 @@ bool ParseFilterRule(Filter& instance, Iterator begin, Iterator end) { | |||
| 112 | SUB(Service, NCM) \ | 112 | SUB(Service, NCM) \ |
| 113 | SUB(Service, NFC) \ | 113 | SUB(Service, NFC) \ |
| 114 | SUB(Service, NFP) \ | 114 | SUB(Service, NFP) \ |
| 115 | SUB(Service, NGCT) \ | 115 | SUB(Service, NGC) \ |
| 116 | SUB(Service, NIFM) \ | 116 | SUB(Service, NIFM) \ |
| 117 | SUB(Service, NIM) \ | 117 | SUB(Service, NIM) \ |
| 118 | SUB(Service, NOTIF) \ | 118 | SUB(Service, NOTIF) \ |
diff --git a/src/common/logging/types.h b/src/common/logging/types.h index 8356e3183..08af50ee0 100644 --- a/src/common/logging/types.h +++ b/src/common/logging/types.h | |||
| @@ -80,7 +80,7 @@ enum class Class : u8 { | |||
| 80 | Service_NCM, ///< The NCM service | 80 | Service_NCM, ///< The NCM service |
| 81 | Service_NFC, ///< The NFC (Near-field communication) service | 81 | Service_NFC, ///< The NFC (Near-field communication) service |
| 82 | Service_NFP, ///< The NFP service | 82 | Service_NFP, ///< The NFP service |
| 83 | Service_NGCT, ///< The NGCT (No Good Content for Terra) service | 83 | Service_NGC, ///< The NGC (No Good Content) service |
| 84 | Service_NIFM, ///< The NIFM (Network interface) service | 84 | Service_NIFM, ///< The NIFM (Network interface) service |
| 85 | Service_NIM, ///< The NIM service | 85 | Service_NIM, ///< The NIM service |
| 86 | Service_NOTIF, ///< The NOTIF (Notification) service | 86 | Service_NOTIF, ///< The NOTIF (Notification) service |
diff --git a/src/common/polyfill_thread.h b/src/common/polyfill_thread.h index b5ef055db..41cbb9ed5 100644 --- a/src/common/polyfill_thread.h +++ b/src/common/polyfill_thread.h | |||
| @@ -19,8 +19,8 @@ | |||
| 19 | namespace Common { | 19 | namespace Common { |
| 20 | 20 | ||
| 21 | template <typename Condvar, typename Lock, typename Pred> | 21 | template <typename Condvar, typename Lock, typename Pred> |
| 22 | void CondvarWait(Condvar& cv, Lock& lock, std::stop_token token, Pred&& pred) { | 22 | void CondvarWait(Condvar& cv, std::unique_lock<Lock>& lk, std::stop_token token, Pred&& pred) { |
| 23 | cv.wait(lock, token, std::move(pred)); | 23 | cv.wait(lk, token, std::move(pred)); |
| 24 | } | 24 | } |
| 25 | 25 | ||
| 26 | template <typename Rep, typename Period> | 26 | template <typename Rep, typename Period> |
| @@ -332,13 +332,17 @@ private: | |||
| 332 | namespace Common { | 332 | namespace Common { |
| 333 | 333 | ||
| 334 | template <typename Condvar, typename Lock, typename Pred> | 334 | template <typename Condvar, typename Lock, typename Pred> |
| 335 | void CondvarWait(Condvar& cv, Lock& lock, std::stop_token token, Pred pred) { | 335 | void CondvarWait(Condvar& cv, std::unique_lock<Lock>& lk, std::stop_token token, Pred pred) { |
| 336 | if (token.stop_requested()) { | 336 | if (token.stop_requested()) { |
| 337 | return; | 337 | return; |
| 338 | } | 338 | } |
| 339 | 339 | ||
| 340 | std::stop_callback callback(token, [&] { cv.notify_all(); }); | 340 | std::stop_callback callback(token, [&] { |
| 341 | cv.wait(lock, [&] { return pred() || token.stop_requested(); }); | 341 | { std::scoped_lock lk2{*lk.mutex()}; } |
| 342 | cv.notify_all(); | ||
| 343 | }); | ||
| 344 | |||
| 345 | cv.wait(lk, [&] { return pred() || token.stop_requested(); }); | ||
| 342 | } | 346 | } |
| 343 | 347 | ||
| 344 | template <typename Rep, typename Period> | 348 | template <typename Rep, typename Period> |
| @@ -353,8 +357,10 @@ bool StoppableTimedWait(std::stop_token token, const std::chrono::duration<Rep, | |||
| 353 | 357 | ||
| 354 | std::stop_callback cb(token, [&] { | 358 | std::stop_callback cb(token, [&] { |
| 355 | // Wake up the waiting thread. | 359 | // Wake up the waiting thread. |
| 356 | std::unique_lock lk{m}; | 360 | { |
| 357 | stop_requested = true; | 361 | std::scoped_lock lk{m}; |
| 362 | stop_requested = true; | ||
| 363 | } | ||
| 358 | cv.notify_one(); | 364 | cv.notify_one(); |
| 359 | }); | 365 | }); |
| 360 | 366 | ||
diff --git a/src/common/settings.h b/src/common/settings.h index b15213bd7..82ec9077e 100644 --- a/src/common/settings.h +++ b/src/common/settings.h | |||
| @@ -348,6 +348,8 @@ struct Values { | |||
| 348 | Category::RendererDebug}; | 348 | Category::RendererDebug}; |
| 349 | Setting<bool> disable_shader_loop_safety_checks{ | 349 | Setting<bool> disable_shader_loop_safety_checks{ |
| 350 | linkage, false, "disable_shader_loop_safety_checks", Category::RendererDebug}; | 350 | linkage, false, "disable_shader_loop_safety_checks", Category::RendererDebug}; |
| 351 | Setting<bool> enable_renderdoc_hotkey{linkage, false, "renderdoc_hotkey", | ||
| 352 | Category::RendererDebug}; | ||
| 351 | 353 | ||
| 352 | // System | 354 | // System |
| 353 | SwitchableSetting<Language, true> language_index{linkage, | 355 | SwitchableSetting<Language, true> language_index{linkage, |