summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorCharles Lombardo <clombardo169@gmail.com>2023-11-04 04:57:57 +0100
committerCharles Lombardo <clombardo169@gmail.com>2023-11-04 05:04:20 +0100
commit9543adf072a7d116e49b2d54359cd7e5b374e594 (patch)
treeca7465eb01f169d609221466451b5b0132e9b495 /src
parentMerge pull request #11954 from t895/log-hardware (diff)
downloadyuzu-9543adf072a7d116e49b2d54359cd7e5b374e594.tar
yuzu-9543adf072a7d116e49b2d54359cd7e5b374e594.tar.gz
yuzu-9543adf072a7d116e49b2d54359cd7e5b374e594.tar.bz2
yuzu-9543adf072a7d116e49b2d54359cd7e5b374e594.tar.lz
yuzu-9543adf072a7d116e49b2d54359cd7e5b374e594.tar.xz
yuzu-9543adf072a7d116e49b2d54359cd7e5b374e594.tar.zst
yuzu-9543adf072a7d116e49b2d54359cd7e5b374e594.zip
Diffstat (limited to 'src')
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt6
-rw-r--r--src/android/app/src/main/jni/native.cpp9
-rw-r--r--src/android/app/src/main/jni/native.h3
3 files changed, 6 insertions, 12 deletions
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt
index c456c0592..77f2cdf65 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt
@@ -414,12 +414,12 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback {
val FRAMETIME = 2
val SPEED = 3
perfStatsUpdater = {
- if (emulationViewModel.emulationStarted.value == true) {
+ if (emulationViewModel.emulationStarted.value) {
val perfStats = NativeLibrary.getPerfStats()
- if (perfStats[FPS] > 0 && _binding != null) {
+ if (_binding != null) {
binding.showFpsText.text = String.format("FPS: %.1f", perfStats[FPS])
}
- perfStatsUpdateHandler.postDelayed(perfStatsUpdater!!, 100)
+ perfStatsUpdateHandler.postDelayed(perfStatsUpdater!!, 800)
}
}
perfStatsUpdateHandler.post(perfStatsUpdater!!)
diff --git a/src/android/app/src/main/jni/native.cpp b/src/android/app/src/main/jni/native.cpp
index 294e41045..2b1c6374d 100644
--- a/src/android/app/src/main/jni/native.cpp
+++ b/src/android/app/src/main/jni/native.cpp
@@ -199,8 +199,8 @@ bool EmulationSession::IsPaused() const {
return m_is_running && m_is_paused;
}
-const Core::PerfStatsResults& EmulationSession::PerfStats() const {
- std::scoped_lock m_perf_stats_lock(m_perf_stats_mutex);
+const Core::PerfStatsResults& EmulationSession::PerfStats() {
+ m_perf_stats = m_system.GetAndResetPerfStats();
return m_perf_stats;
}
@@ -381,11 +381,6 @@ void EmulationSession::RunEmulation() {
break;
}
}
- {
- // Refresh performance stats.
- std::scoped_lock m_perf_stats_lock(m_perf_stats_mutex);
- m_perf_stats = m_system.GetAndResetPerfStats();
- }
}
}
diff --git a/src/android/app/src/main/jni/native.h b/src/android/app/src/main/jni/native.h
index 0aa2b085b..9f915b160 100644
--- a/src/android/app/src/main/jni/native.h
+++ b/src/android/app/src/main/jni/native.h
@@ -41,7 +41,7 @@ public:
void RunEmulation();
void ShutdownEmulation();
- const Core::PerfStatsResults& PerfStats() const;
+ const Core::PerfStatsResults& PerfStats();
void ConfigureFilesystemProvider(const std::string& filepath);
void InitializeSystem();
Core::SystemResultStatus InitializeEmulation(const std::string& filepath);
@@ -80,6 +80,5 @@ private:
// Synchronization
std::condition_variable_any m_cv;
- mutable std::mutex m_perf_stats_mutex;
mutable std::mutex m_mutex;
};