From 2291855a1f6ced85ec1122f36b3ce550ebac383d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sun, 24 Sep 2023 21:41:09 +0200 Subject: [PATCH] Remove dead code path --- android/jni/app-android.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/android/jni/app-android.cpp b/android/jni/app-android.cpp index 1d667d72eb..5f9d6ea031 100644 --- a/android/jni/app-android.cpp +++ b/android/jni/app-android.cpp @@ -872,6 +872,7 @@ extern "C" void Java_org_ppsspp_ppsspp_NativeApp_pause(JNIEnv *, jclass) { } extern "C" void Java_org_ppsspp_ppsspp_NativeApp_shutdown(JNIEnv *, jclass) { + INFO_LOG(SYSTEM, "NativeApp.shutdown() -- begin"); if (renderer_inited && useCPUThread && graphicsContext) { // Only used in Java EGL path. EmuThreadStop("shutdown"); @@ -891,8 +892,7 @@ extern "C" void Java_org_ppsspp_ppsspp_NativeApp_shutdown(JNIEnv *, jclass) { EmuThreadJoin(); } - INFO_LOG(SYSTEM, "NativeApp.shutdown() -- begin"); - if (renderer_inited) { + if (graphicsContext) { INFO_LOG(G3D, "Shutting down renderer"); graphicsContext->Shutdown(); delete graphicsContext; @@ -1135,6 +1135,9 @@ void UpdateRunLoopAndroid(JNIEnv *env) { } extern "C" void Java_org_ppsspp_ppsspp_NativeRenderer_displayRender(JNIEnv *env, jobject obj) { + // This doesn't get called on the Vulkan path. + _assert_(useCPUThread); + static bool hasSetThreadName = false; if (!hasSetThreadName) { hasSetThreadName = true; @@ -1144,13 +1147,9 @@ extern "C" void Java_org_ppsspp_ppsspp_NativeRenderer_displayRender(JNIEnv *env, if (IsVREnabled() && !StartVRRender()) return; - if (useCPUThread) { - // This is the "GPU thread". Call ThreadFrame. - if (!graphicsContext || !graphicsContext->ThreadFrame()) { - return; - } - } else { - UpdateRunLoopAndroid(env); + // This is the "GPU thread". Call ThreadFrame. + if (!graphicsContext || !graphicsContext->ThreadFrame()) { + return; } if (IsVREnabled()) { @@ -1457,6 +1456,7 @@ static void ProcessFrameCommands(JNIEnv *env) { } // This runs in Vulkan mode only. +// This handles the entire lifecycle of the Vulkan context, init and exit. extern "C" bool JNICALL Java_org_ppsspp_ppsspp_NativeActivity_runVulkanRenderLoop(JNIEnv *env, jobject obj, jobject _surf) { _assert_(!useCPUThread); @@ -1507,11 +1507,11 @@ extern "C" bool JNICALL Java_org_ppsspp_ppsspp_NativeActivity_runVulkanRenderLoo hasSetThreadName = true; SetCurrentThreadName("AndroidRender"); } - } - while (!exitRenderLoop) { - LockedNativeUpdateRender(); - ProcessFrameCommands(env); + while (!exitRenderLoop) { + LockedNativeUpdateRender(); + ProcessFrameCommands(env); + } } INFO_LOG(G3D, "Leaving EGL/Vulkan render loop.");