diff --git a/android/jni/app-android.cpp b/android/jni/app-android.cpp index 747629bde6..1e54500f0f 100644 --- a/android/jni/app-android.cpp +++ b/android/jni/app-android.cpp @@ -448,7 +448,7 @@ retry: case (int)GPUBackend::VULKAN: ILOG("NativeApp.init() -- creating Vulkan context"); useCPUThread = false; // The Vulkan render manager manages its own thread. - graphicsContext = new AndroidVulkanContext(); + // We create and destroy the Vulkan graphics context in the "EGL" thread. break; default: ELOG("NativeApp.init(): iGPUBackend %d not supported. Switching to OpenGL.", (int)g_Config.iGPUBackend); @@ -931,6 +931,12 @@ retry: int tries = 0; + _assert_msg_(G3D, !graphicsContext, "Graphics context already exists entering runEGLRenderLoop - this is wrong."); + + if (vulkan) { + graphicsContext = new AndroidVulkanContext(); + } + if (!graphicsContext->InitFromRenderThread(wnd, desiredBackbufferSizeX, desiredBackbufferSizeY, backbuffer_format, androidVersion)) { ELOG("Failed to initialize graphics context.");