diff --git a/MobileGL/MG_Impl/GLImpl/Getter/GL_Getter.cpp b/MobileGL/MG_Impl/GLImpl/Getter/GL_Getter.cpp index 934e4b99..f9a4e11f 100644 --- a/MobileGL/MG_Impl/GLImpl/Getter/GL_Getter.cpp +++ b/MobileGL/MG_Impl/GLImpl/Getter/GL_Getter.cpp @@ -213,8 +213,13 @@ namespace MobileGL::MG_Impl::GLImpl { GLint maxSamples = 0; for (const auto& attachment : drawFbo->GetAllAttachmentObjects()) { - if (!attachment.IsRenderbuffer() || !attachment.GetRenderbuffer()) continue; - maxSamples = std::max(maxSamples, static_cast(attachment.GetRenderbuffer()->GetSamples())); + if (attachment.IsRenderbuffer() && attachment.GetRenderbuffer()) { + maxSamples = std::max(maxSamples, static_cast(attachment.GetRenderbuffer()->GetSamples())); + } else if (attachment.IsTexture() && attachment.GetTexture()) { + // Multisample texture attachments count too (GL_SAMPLE_BUFFERS must + // report 1 for any multisampled draw framebuffer). + maxSamples = std::max(maxSamples, static_cast(attachment.GetTexture()->GetSamples())); + } } return maxSamples; }