From 77045b89ad0f5a2ff4757546e6a675553c69400c Mon Sep 17 00:00:00 2001 From: Mark Pearce Date: Fri, 22 May 2026 01:43:27 +0800 Subject: [PATCH] libretro: call SetGLCoreContext(true) in LibretroGLCoreContext MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit LibretroGLCoreContext is the backend for RETRO_HW_CONTEXT_OPENGL_CORE, so the frontend hands us a desktop GL Core profile context. But CreateDrawContext() never told GLFeatures about it — useCoreContext stayed at its default false and gl_extensions.IsCoreContext stayed false, so the macOS Core-profile workaround at GLFeatures.cpp:532 (which force-enables ARB_framebuffer_object because Apple's Core driver doesn't list it as an extension) never fired. Every glBindFramebuffer(GL_FRAMEBUFFER, g_defaultFBO) in GLQueueRunner::fbo_unbind then fell through both branches and silently no-op'd, so the BackBuffer present pass rendered into nothing and GL_INVALID_OPERATION accumulated. End result: black screen on macOS, audio and game logic still working. One-line fix: call SetGLCoreContext(true) before CheckGLExtensions(). --- libretro/LibretroGLCoreContext.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libretro/LibretroGLCoreContext.cpp b/libretro/LibretroGLCoreContext.cpp index f2c9306744..336e61db9a 100644 --- a/libretro/LibretroGLCoreContext.cpp +++ b/libretro/LibretroGLCoreContext.cpp @@ -24,6 +24,13 @@ void LibretroGLCoreContext::CreateDrawContext() { } #endif glewInitDone = true; + // We requested RETRO_HW_CONTEXT_OPENGL_CORE; tell GLFeatures so the + // Core-profile workaround in CheckGLExtensions (which force-enables + // ARB_framebuffer_object / ARB_vertex_array_object) fires. Apple's + // Core driver doesn't list these as extensions, so without this both + // stay false and glBindFramebuffer(default) silently no-ops in + // GLQueueRunner::fbo_unbind on macOS → black screen. + SetGLCoreContext(true); CheckGLExtensions(); } draw_ = Draw::T3DCreateGLContext(false);