From b725f4e144006daac3a13e986e883a928736f6a9 Mon Sep 17 00:00:00 2001 From: Sean Harmer Date: Sat, 13 Feb 2016 14:23:48 +0000 Subject: Cache results of multiple render target support Change-Id: I9e706690d4d2ddaae6c84b0e24de7698704e862d Reviewed-by: Laszlo Agocs --- src/gui/opengl/qopenglframebufferobject.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/gui/opengl') diff --git a/src/gui/opengl/qopenglframebufferobject.cpp b/src/gui/opengl/qopenglframebufferobject.cpp index 4ae01c53ef..5f5b7f46ec 100644 --- a/src/gui/opengl/qopenglframebufferobject.cpp +++ b/src/gui/opengl/qopenglframebufferobject.cpp @@ -1728,7 +1728,8 @@ void QOpenGLFramebufferObject::blitFramebuffer(QOpenGLFramebufferObject *target, extensions.glBindFramebuffer(GL_READ_FRAMEBUFFER, source ? source->handle() : defaultFboId); extensions.glBindFramebuffer(GL_DRAW_FRAMEBUFFER, target ? target->handle() : defaultFboId); - if (extensions.hasOpenGLFeature(QOpenGLFunctions::MultipleRenderTargets)) { + const bool supportsMRT = extensions.hasOpenGLFeature(QOpenGLFunctions::MultipleRenderTargets); + if (supportsMRT) { extensions.glReadBuffer(GL_COLOR_ATTACHMENT0 + readColorAttachmentIndex); if (target) { GLenum drawBuf = GL_COLOR_ATTACHMENT0 + drawColorAttachmentIndex; @@ -1740,7 +1741,7 @@ void QOpenGLFramebufferObject::blitFramebuffer(QOpenGLFramebufferObject *target, tx0, ty0, tx1, ty1, buffers, filter); - if (extensions.hasOpenGLFeature(QOpenGLFunctions::MultipleRenderTargets)) + if (supportsMRT) extensions.glReadBuffer(GL_COLOR_ATTACHMENT0); switch (restorePolicy) { -- cgit v1.2.3