From be37937614c09449f83b07c4023206f2c225c31b Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Sun, 1 Nov 2020 15:44:34 +0100 Subject: [PATCH] rhi: gl: Do not bother with glDrawBuffers(GL_BACK) It's per framebuffer and the color target for the default fbo is never altered. So no need for this call. This is useful because it avoids having to deal with the controversy around GL_BACK (where the GL, but not the ES, spec claims some quite nonsensical things about GL_BACK not being accepted by glDrawBuffers (in the name of stereo support?), nevermind GL_BACK being the default value...), and while what we have in place now seems to be ok with many implementations, it may generate a GL error with others - so just remove the call in order not have to think about this legacy nonsense) Task-number: QTBUG-88070 Change-Id: I051c60a3041865a3434801b57da2b7acb518b8fe Reviewed-by: Andy Nichols --- src/gui/rhi/qrhigles2.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/gui/rhi/qrhigles2.cpp b/src/gui/rhi/qrhigles2.cpp index 785c341a0f8..3ebc0f91827 100644 --- a/src/gui/rhi/qrhigles2.cpp +++ b/src/gui/rhi/qrhigles2.cpp @@ -2399,10 +2399,6 @@ void QRhiGles2::executeCommandBuffer(QRhiCommandBuffer *cb) } } else { f->glBindFramebuffer(GL_FRAMEBUFFER, ctx->defaultFramebufferObject()); - if (caps.maxDrawBuffers > 1) { - GLenum bufs = GL_BACK; - f->glDrawBuffers(1, &bufs); - } } if (caps.srgbCapableDefaultFramebuffer) { if (cmd.args.bindFramebuffer.srgb)