From 8f39ad3555ae5aac2856a34af943d94d5035960e Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Mon, 3 Oct 2022 23:38:36 +1000 Subject: [PATCH] GPU/OpenGL: Don't recreate context on sw switch when using GLES --- src/core/gpu_hw_opengl.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/gpu_hw_opengl.cpp b/src/core/gpu_hw_opengl.cpp index 2de16eae9..a19e42099 100644 --- a/src/core/gpu_hw_opengl.cpp +++ b/src/core/gpu_hw_opengl.cpp @@ -43,7 +43,10 @@ GPURenderer GPU_HW_OpenGL::GetRendererType() const bool GPU_HW_OpenGL::Initialize() { - if (!Host::AcquireHostDisplay(RenderAPI::OpenGL)) + // Don't re-request GL when we already have GLES here... + const RenderAPI current_api = g_host_display ? g_host_display->GetRenderAPI() : RenderAPI::None; + if (current_api != RenderAPI::OpenGL && current_api != RenderAPI::OpenGLES && + !Host::AcquireHostDisplay(RenderAPI::OpenGL)) { Log_ErrorPrintf("Host render API type is incompatible"); return false;