Fix issue with Vulkan task switching and resolution changes on Android.

This commit is contained in:
Henrik Rydgård
2018-02-12 17:47:31 +01:00
parent 038d8b7f3e
commit 926b3873df
+7 -1
View File
@@ -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.");