mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-11 21:58:31 +09:00
[Fix] (MG_Impl): count multisample texture attachments in GL_SAMPLE_BUFFERS
The draw-framebuffer sample resolver only looked at renderbuffer attachments, so framebuffers with multisample texture attachments reported GL_SAMPLE_BUFFERS == 0 and callers took single-sampled paths (the CTS blit helpers read multisampled attachments based on it).
This commit is contained in:
@@ -213,8 +213,13 @@ namespace MobileGL::MG_Impl::GLImpl {
|
|||||||
|
|
||||||
GLint maxSamples = 0;
|
GLint maxSamples = 0;
|
||||||
for (const auto& attachment : drawFbo->GetAllAttachmentObjects()) {
|
for (const auto& attachment : drawFbo->GetAllAttachmentObjects()) {
|
||||||
if (!attachment.IsRenderbuffer() || !attachment.GetRenderbuffer()) continue;
|
if (attachment.IsRenderbuffer() && attachment.GetRenderbuffer()) {
|
||||||
maxSamples = std::max(maxSamples, static_cast<GLint>(attachment.GetRenderbuffer()->GetSamples()));
|
maxSamples = std::max(maxSamples, static_cast<GLint>(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<GLint>(attachment.GetTexture()->GetSamples()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return maxSamples;
|
return maxSamples;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user