diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/x64/native_clock.cpp | 6 | ||||
| -rw-r--r-- | src/core/hle/service/audio/hwopus.cpp | 4 | ||||
| -rw-r--r-- | src/core/perf_stats.h | 4 | ||||
| -rw-r--r-- | src/video_core/shader_notify.cpp | 2 | ||||
| -rw-r--r-- | src/video_core/shader_notify.h | 2 | ||||
| -rw-r--r-- | src/yuzu/loading_screen.cpp | 4 | ||||
| -rw-r--r-- | src/yuzu/loading_screen.h | 4 |
7 files changed, 13 insertions, 13 deletions
diff --git a/src/common/x64/native_clock.cpp b/src/common/x64/native_clock.cpp index 87de40624..28f834443 100644 --- a/src/common/x64/native_clock.cpp +++ b/src/common/x64/native_clock.cpp | |||
| @@ -19,16 +19,16 @@ u64 EstimateRDTSCFrequency() { | |||
| 19 | // get current time | 19 | // get current time |
| 20 | _mm_mfence(); | 20 | _mm_mfence(); |
| 21 | const u64 tscStart = __rdtsc(); | 21 | const u64 tscStart = __rdtsc(); |
| 22 | const auto startTime = std::chrono::high_resolution_clock::now(); | 22 | const auto startTime = std::chrono::steady_clock::now(); |
| 23 | // wait roughly 3 seconds | 23 | // wait roughly 3 seconds |
| 24 | while (true) { | 24 | while (true) { |
| 25 | auto milli = std::chrono::duration_cast<std::chrono::milliseconds>( | 25 | auto milli = std::chrono::duration_cast<std::chrono::milliseconds>( |
| 26 | std::chrono::high_resolution_clock::now() - startTime); | 26 | std::chrono::steady_clock::now() - startTime); |
| 27 | if (milli.count() >= 3000) | 27 | if (milli.count() >= 3000) |
| 28 | break; | 28 | break; |
| 29 | std::this_thread::sleep_for(milli_10); | 29 | std::this_thread::sleep_for(milli_10); |
| 30 | } | 30 | } |
| 31 | const auto endTime = std::chrono::high_resolution_clock::now(); | 31 | const auto endTime = std::chrono::steady_clock::now(); |
| 32 | _mm_mfence(); | 32 | _mm_mfence(); |
| 33 | const u64 tscEnd = __rdtsc(); | 33 | const u64 tscEnd = __rdtsc(); |
| 34 | // calculate difference | 34 | // calculate difference |
diff --git a/src/core/hle/service/audio/hwopus.cpp b/src/core/hle/service/audio/hwopus.cpp index 7da1f2969..981b6c996 100644 --- a/src/core/hle/service/audio/hwopus.cpp +++ b/src/core/hle/service/audio/hwopus.cpp | |||
| @@ -96,7 +96,7 @@ private: | |||
| 96 | 96 | ||
| 97 | bool DecodeOpusData(u32& consumed, u32& sample_count, const std::vector<u8>& input, | 97 | bool DecodeOpusData(u32& consumed, u32& sample_count, const std::vector<u8>& input, |
| 98 | std::vector<opus_int16>& output, u64* out_performance_time) const { | 98 | std::vector<opus_int16>& output, u64* out_performance_time) const { |
| 99 | const auto start_time = std::chrono::high_resolution_clock::now(); | 99 | const auto start_time = std::chrono::steady_clock::now(); |
| 100 | const std::size_t raw_output_sz = output.size() * sizeof(opus_int16); | 100 | const std::size_t raw_output_sz = output.size() * sizeof(opus_int16); |
| 101 | if (sizeof(OpusPacketHeader) > input.size()) { | 101 | if (sizeof(OpusPacketHeader) > input.size()) { |
| 102 | LOG_ERROR(Audio, "Input is smaller than the header size, header_sz={}, input_sz={}", | 102 | LOG_ERROR(Audio, "Input is smaller than the header size, header_sz={}, input_sz={}", |
| @@ -135,7 +135,7 @@ private: | |||
| 135 | return false; | 135 | return false; |
| 136 | } | 136 | } |
| 137 | 137 | ||
| 138 | const auto end_time = std::chrono::high_resolution_clock::now() - start_time; | 138 | const auto end_time = std::chrono::steady_clock::now() - start_time; |
| 139 | sample_count = out_sample_count; | 139 | sample_count = out_sample_count; |
| 140 | consumed = static_cast<u32>(sizeof(OpusPacketHeader) + hdr.size); | 140 | consumed = static_cast<u32>(sizeof(OpusPacketHeader) + hdr.size); |
| 141 | if (out_performance_time != nullptr) { | 141 | if (out_performance_time != nullptr) { |
diff --git a/src/core/perf_stats.h b/src/core/perf_stats.h index a2541906f..816202588 100644 --- a/src/core/perf_stats.h +++ b/src/core/perf_stats.h | |||
| @@ -33,7 +33,7 @@ public: | |||
| 33 | explicit PerfStats(u64 title_id_); | 33 | explicit PerfStats(u64 title_id_); |
| 34 | ~PerfStats(); | 34 | ~PerfStats(); |
| 35 | 35 | ||
| 36 | using Clock = std::chrono::high_resolution_clock; | 36 | using Clock = std::chrono::steady_clock; |
| 37 | 37 | ||
| 38 | void BeginSystemFrame(); | 38 | void BeginSystemFrame(); |
| 39 | void EndSystemFrame(); | 39 | void EndSystemFrame(); |
| @@ -87,7 +87,7 @@ private: | |||
| 87 | 87 | ||
| 88 | class SpeedLimiter { | 88 | class SpeedLimiter { |
| 89 | public: | 89 | public: |
| 90 | using Clock = std::chrono::high_resolution_clock; | 90 | using Clock = std::chrono::steady_clock; |
| 91 | 91 | ||
| 92 | void DoSpeedLimiting(std::chrono::microseconds current_system_time_us); | 92 | void DoSpeedLimiting(std::chrono::microseconds current_system_time_us); |
| 93 | 93 | ||
diff --git a/src/video_core/shader_notify.cpp b/src/video_core/shader_notify.cpp index dc6995b46..bcaf5f575 100644 --- a/src/video_core/shader_notify.cpp +++ b/src/video_core/shader_notify.cpp | |||
| @@ -18,7 +18,7 @@ int ShaderNotify::ShadersBuilding() noexcept { | |||
| 18 | const int now_complete = num_complete.load(std::memory_order::relaxed); | 18 | const int now_complete = num_complete.load(std::memory_order::relaxed); |
| 19 | const int now_building = num_building.load(std::memory_order::relaxed); | 19 | const int now_building = num_building.load(std::memory_order::relaxed); |
| 20 | if (now_complete == now_building) { | 20 | if (now_complete == now_building) { |
| 21 | const auto now = std::chrono::high_resolution_clock::now(); | 21 | const auto now = std::chrono::steady_clock::now(); |
| 22 | if (completed && num_complete == num_when_completed) { | 22 | if (completed && num_complete == num_when_completed) { |
| 23 | if (now - complete_time > TIME_TO_STOP_REPORTING) { | 23 | if (now - complete_time > TIME_TO_STOP_REPORTING) { |
| 24 | report_base = now_complete; | 24 | report_base = now_complete; |
diff --git a/src/video_core/shader_notify.h b/src/video_core/shader_notify.h index ad363bfb5..4d8d52071 100644 --- a/src/video_core/shader_notify.h +++ b/src/video_core/shader_notify.h | |||
| @@ -28,6 +28,6 @@ private: | |||
| 28 | 28 | ||
| 29 | bool completed{}; | 29 | bool completed{}; |
| 30 | int num_when_completed{}; | 30 | int num_when_completed{}; |
| 31 | std::chrono::high_resolution_clock::time_point complete_time; | 31 | std::chrono::steady_clock::time_point complete_time; |
| 32 | }; | 32 | }; |
| 33 | } // namespace VideoCore | 33 | } // namespace VideoCore |
diff --git a/src/yuzu/loading_screen.cpp b/src/yuzu/loading_screen.cpp index ae842306c..b001b8c23 100644 --- a/src/yuzu/loading_screen.cpp +++ b/src/yuzu/loading_screen.cpp | |||
| @@ -136,7 +136,7 @@ void LoadingScreen::OnLoadComplete() { | |||
| 136 | void LoadingScreen::OnLoadProgress(VideoCore::LoadCallbackStage stage, std::size_t value, | 136 | void LoadingScreen::OnLoadProgress(VideoCore::LoadCallbackStage stage, std::size_t value, |
| 137 | std::size_t total) { | 137 | std::size_t total) { |
| 138 | using namespace std::chrono; | 138 | using namespace std::chrono; |
| 139 | const auto now = high_resolution_clock::now(); | 139 | const auto now = steady_clock::now(); |
| 140 | // reset the timer if the stage changes | 140 | // reset the timer if the stage changes |
| 141 | if (stage != previous_stage) { | 141 | if (stage != previous_stage) { |
| 142 | ui->progress_bar->setStyleSheet(QString::fromUtf8(progressbar_style[stage])); | 142 | ui->progress_bar->setStyleSheet(QString::fromUtf8(progressbar_style[stage])); |
| @@ -160,7 +160,7 @@ void LoadingScreen::OnLoadProgress(VideoCore::LoadCallbackStage stage, std::size | |||
| 160 | // If theres a drastic slowdown in the rate, then display an estimate | 160 | // If theres a drastic slowdown in the rate, then display an estimate |
| 161 | if (now - previous_time > milliseconds{50} || slow_shader_compile_start) { | 161 | if (now - previous_time > milliseconds{50} || slow_shader_compile_start) { |
| 162 | if (!slow_shader_compile_start) { | 162 | if (!slow_shader_compile_start) { |
| 163 | slow_shader_start = high_resolution_clock::now(); | 163 | slow_shader_start = steady_clock::now(); |
| 164 | slow_shader_compile_start = true; | 164 | slow_shader_compile_start = true; |
| 165 | slow_shader_first_value = value; | 165 | slow_shader_first_value = value; |
| 166 | } | 166 | } |
diff --git a/src/yuzu/loading_screen.h b/src/yuzu/loading_screen.h index 801d08e1a..29155a77c 100644 --- a/src/yuzu/loading_screen.h +++ b/src/yuzu/loading_screen.h | |||
| @@ -84,8 +84,8 @@ private: | |||
| 84 | // shaders, it will start quickly but end slow if new shaders were added since previous launch. | 84 | // shaders, it will start quickly but end slow if new shaders were added since previous launch. |
| 85 | // These variables are used to detect the change in speed so we can generate an ETA | 85 | // These variables are used to detect the change in speed so we can generate an ETA |
| 86 | bool slow_shader_compile_start = false; | 86 | bool slow_shader_compile_start = false; |
| 87 | std::chrono::high_resolution_clock::time_point slow_shader_start; | 87 | std::chrono::steady_clock::time_point slow_shader_start; |
| 88 | std::chrono::high_resolution_clock::time_point previous_time; | 88 | std::chrono::steady_clock::time_point previous_time; |
| 89 | std::size_t slow_shader_first_value = 0; | 89 | std::size_t slow_shader_first_value = 0; |
| 90 | }; | 90 | }; |
| 91 | 91 | ||