diff options
| author | 2024-01-24 13:47:41 -0500 | |
|---|---|---|
| committer | 2024-01-25 13:04:03 -0500 | |
| commit | 35794f4f18dcb4e596829e53135a34daef9f1149 (patch) | |
| tree | 574e9cb1d808c83cd604baea5fb7d6a1ed9a34f3 | |
| parent | Merge pull request #12781 from goldenx86/dozen (diff) | |
| download | yuzu-35794f4f18dcb4e596829e53135a34daef9f1149.tar.gz yuzu-35794f4f18dcb4e596829e53135a34daef9f1149.tar.xz yuzu-35794f4f18dcb4e596829e53135a34daef9f1149.zip | |
android: Add current driver vendor to FPS overlay
Diffstat (limited to '')
3 files changed, 15 insertions, 2 deletions
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/NativeLibrary.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/NativeLibrary.kt index c408485c6..5b9f553f7 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/NativeLibrary.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/NativeLibrary.kt | |||
| @@ -303,6 +303,11 @@ object NativeLibrary { | |||
| 303 | */ | 303 | */ |
| 304 | external fun getCpuBackend(): String | 304 | external fun getCpuBackend(): String |
| 305 | 305 | ||
| 306 | /** | ||
| 307 | * Returns the current GPU Driver. | ||
| 308 | */ | ||
| 309 | external fun getGpuDriver(): String | ||
| 310 | |||
| 306 | external fun applySettings() | 311 | external fun applySettings() |
| 307 | 312 | ||
| 308 | external fun logSettings() | 313 | external fun logSettings() |
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 2a97ae14d..82f8e3b50 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 | |||
| @@ -485,12 +485,15 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback { | |||
| 485 | val FRAMETIME = 2 | 485 | val FRAMETIME = 2 |
| 486 | val SPEED = 3 | 486 | val SPEED = 3 |
| 487 | perfStatsUpdater = { | 487 | perfStatsUpdater = { |
| 488 | if (emulationViewModel.emulationStarted.value) { | 488 | if (emulationViewModel.emulationStarted.value && |
| 489 | !emulationViewModel.isEmulationStopping.value | ||
| 490 | ) { | ||
| 489 | val perfStats = NativeLibrary.getPerfStats() | 491 | val perfStats = NativeLibrary.getPerfStats() |
| 490 | val cpuBackend = NativeLibrary.getCpuBackend() | 492 | val cpuBackend = NativeLibrary.getCpuBackend() |
| 493 | val gpuDriver = NativeLibrary.getGpuDriver() | ||
| 491 | if (_binding != null) { | 494 | if (_binding != null) { |
| 492 | binding.showFpsText.text = | 495 | binding.showFpsText.text = |
| 493 | String.format("FPS: %.1f\n%s", perfStats[FPS], cpuBackend) | 496 | String.format("FPS: %.1f\n%s/%s", perfStats[FPS], cpuBackend, gpuDriver) |
| 494 | } | 497 | } |
| 495 | perfStatsUpdateHandler.postDelayed(perfStatsUpdater!!, 800) | 498 | perfStatsUpdateHandler.postDelayed(perfStatsUpdater!!, 800) |
| 496 | } | 499 | } |
diff --git a/src/android/app/src/main/jni/native.cpp b/src/android/app/src/main/jni/native.cpp index 963f57380..c6c55b20c 100644 --- a/src/android/app/src/main/jni/native.cpp +++ b/src/android/app/src/main/jni/native.cpp | |||
| @@ -674,6 +674,11 @@ jstring Java_org_yuzu_yuzu_1emu_NativeLibrary_getCpuBackend(JNIEnv* env, jclass | |||
| 674 | return ToJString(env, "JIT"); | 674 | return ToJString(env, "JIT"); |
| 675 | } | 675 | } |
| 676 | 676 | ||
| 677 | jstring Java_org_yuzu_yuzu_1emu_NativeLibrary_getGpuDriver(JNIEnv* env, jobject jobj) { | ||
| 678 | return ToJString(env, | ||
| 679 | EmulationSession::GetInstance().System().GPU().Renderer().GetDeviceVendor()); | ||
| 680 | } | ||
| 681 | |||
| 677 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_applySettings(JNIEnv* env, jobject jobj) { | 682 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_applySettings(JNIEnv* env, jobject jobj) { |
| 678 | EmulationSession::GetInstance().System().ApplySettings(); | 683 | EmulationSession::GetInstance().System().ApplySettings(); |
| 679 | } | 684 | } |