diff --git a/MobileGL/MG_Impl/GLImpl/Framebuffer/GL_Framebuffer.cpp b/MobileGL/MG_Impl/GLImpl/Framebuffer/GL_Framebuffer.cpp index bed9a41f..077e58c3 100644 --- a/MobileGL/MG_Impl/GLImpl/Framebuffer/GL_Framebuffer.cpp +++ b/MobileGL/MG_Impl/GLImpl/Framebuffer/GL_Framebuffer.cpp @@ -625,8 +625,11 @@ namespace MobileGL::MG_Impl::GLImpl { const Int maxSamples = GetMaxRenderbufferSamples_State(); if (samples > maxSamples) { // TODO: Use per-internalformat renderbuffer sample limits once glGetInternalformativ is backed. + // GL 4.6 core 9.2.4 makes asking for more samples than the format supports + // INVALID_OPERATION, not INVALID_VALUE - the count is well formed, this format just + // cannot deliver it. Only a negative count is INVALID_VALUE. MG_State::pGLContext->RecordError( - ErrorCode::InvalidValue, + ErrorCode::InvalidOperation, MakeUnique( "MG_Impl/GLImpl", caller, std::format("Sample count {} exceeds GL_MAX_SAMPLES ({}).", samples, maxSamples)));