Merge pull request #10611 from hrydgard/vulkan-android-task-switch

Fix issue with Vulkan task switching and resolution changes on Android.
This commit is contained in:
Unknown W. Brackets 2018-02-13 02:05:02 +00:00 committed by GitHub
commit 864eb5dcad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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.");