From 4873da6844dbe792718248bf5d74b03545d30b6a Mon Sep 17 00:00:00 2001 From: BZLZHH Date: Wed, 5 Aug 2026 00:51:12 -0400 Subject: [PATCH] [Fix] (MG_Impl): accept COLOR when invalidating the default framebuffer The validation added with the invalidation entry points took the default framebuffer's buffers to be only FRONT_LEFT, FRONT_RIGHT, BACK_LEFT, BACK_RIGHT, DEPTH and STENCIL, so a call naming COLOR came back INVALID_ENUM. The by-name forms spell the colour buffer the way glClearNamedFramebuffer does - COLOR, DEPTH, STENCIL - while the target forms use the individual left/right tokens, and both spellings arrive at the same validation, so both sets belong there (GL 4.6 core 17.4.4). Caught by framebuffers_invalidate_data and framebuffers_invalidate_subdata, which had been passing while the entry points were stubs doing nothing at all. Those two plus invalidate_data_and_subdata_errors now pass together on both backends. --- MobileGL/MG_Impl/GLImpl/Framebuffer/GL_Framebuffer.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/MobileGL/MG_Impl/GLImpl/Framebuffer/GL_Framebuffer.cpp b/MobileGL/MG_Impl/GLImpl/Framebuffer/GL_Framebuffer.cpp index 90bf9b44..3a1614d1 100644 --- a/MobileGL/MG_Impl/GLImpl/Framebuffer/GL_Framebuffer.cpp +++ b/MobileGL/MG_Impl/GLImpl/Framebuffer/GL_Framebuffer.cpp @@ -1691,6 +1691,11 @@ namespace MobileGL::MG_Impl::GLImpl { const GLenum attachment = attachments[at]; if (isDefaultFramebuffer) { switch (attachment) { + // The by-name forms name the default framebuffer's buffers the way + // glClearNamedFramebuffer does, with COLOR standing for the colour buffer, while + // the target forms use the individual FRONT_LEFT/BACK_RIGHT tokens. Both spellings + // reach here, so both are accepted (GL 4.6 core 17.4.4). + case GL_COLOR: case GL_FRONT_LEFT: case GL_FRONT_RIGHT: case GL_BACK_LEFT: