diff options
| author | 2023-07-02 15:05:35 -0400 | |
|---|---|---|
| committer | 2023-07-02 15:08:04 -0400 | |
| commit | c3fbc8d2fe2ff423d774ed3886fc8391c730f637 (patch) | |
| tree | f069809e0b2c5f033b016b267705e507a970ae88 /src/yuzu_cmd | |
| parent | Merge pull request #10949 from t895/memory-requirements (diff) | |
| download | yuzu-c3fbc8d2fe2ff423d774ed3886fc8391c730f637.tar.gz yuzu-c3fbc8d2fe2ff423d774ed3886fc8391c730f637.tar.xz yuzu-c3fbc8d2fe2ff423d774ed3886fc8391c730f637.zip | |
core_timing: Remove GetCurrentTimerResolution in CoreTiming loop
Other programs may change this value, but if thousands of syscalls in this loop is undesirable, then we can just set this once.
Diffstat (limited to 'src/yuzu_cmd')
| -rw-r--r-- | src/yuzu_cmd/yuzu.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/yuzu_cmd/yuzu.cpp b/src/yuzu_cmd/yuzu.cpp index 7b6d49c63..d0433ffc6 100644 --- a/src/yuzu_cmd/yuzu.cpp +++ b/src/yuzu_cmd/yuzu.cpp | |||
| @@ -21,6 +21,7 @@ | |||
| 21 | #include "common/string_util.h" | 21 | #include "common/string_util.h" |
| 22 | #include "common/telemetry.h" | 22 | #include "common/telemetry.h" |
| 23 | #include "core/core.h" | 23 | #include "core/core.h" |
| 24 | #include "core/core_timing.h" | ||
| 24 | #include "core/cpu_manager.h" | 25 | #include "core/cpu_manager.h" |
| 25 | #include "core/crypto/key_manager.h" | 26 | #include "core/crypto/key_manager.h" |
| 26 | #include "core/file_sys/registered_cache.h" | 27 | #include "core/file_sys/registered_cache.h" |
| @@ -316,8 +317,6 @@ int main(int argc, char** argv) { | |||
| 316 | 317 | ||
| 317 | #ifdef _WIN32 | 318 | #ifdef _WIN32 |
| 318 | LocalFree(argv_w); | 319 | LocalFree(argv_w); |
| 319 | |||
| 320 | Common::Windows::SetCurrentTimerResolutionToMaximum(); | ||
| 321 | #endif | 320 | #endif |
| 322 | 321 | ||
| 323 | MicroProfileOnThreadCreate("EmuThread"); | 322 | MicroProfileOnThreadCreate("EmuThread"); |
| @@ -351,6 +350,11 @@ int main(int argc, char** argv) { | |||
| 351 | break; | 350 | break; |
| 352 | } | 351 | } |
| 353 | 352 | ||
| 353 | #ifdef _WIN32 | ||
| 354 | Common::Windows::SetCurrentTimerResolutionToMaximum(); | ||
| 355 | system.CoreTiming().SetTimerResolutionNs(Common::Windows::GetCurrentTimerResolution()); | ||
| 356 | #endif | ||
| 357 | |||
| 354 | system.SetContentProvider(std::make_unique<FileSys::ContentProviderUnion>()); | 358 | system.SetContentProvider(std::make_unique<FileSys::ContentProviderUnion>()); |
| 355 | system.SetFilesystem(std::make_shared<FileSys::RealVfsFilesystem>()); | 359 | system.SetFilesystem(std::make_shared<FileSys::RealVfsFilesystem>()); |
| 356 | system.GetFileSystemController().CreateFactories(*system.GetFilesystem()); | 360 | system.GetFileSystemController().CreateFactories(*system.GetFilesystem()); |