diff options
author | Sean Harmer <sean.harmer@kdab.com> | 2016-02-13 14:23:48 +0000 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2016-02-14 18:13:42 +0000 |
commit | b725f4e144006daac3a13e986e883a928736f6a9 (patch) | |
tree | 64db15f91832346eb87089a3b38d8c8c9981388c | |
parent | 48ca7f6220df4b1dc62fda905d5f8ae0b6e6e41c (diff) |
Cache results of multiple render target support
Change-Id: I9e706690d4d2ddaae6c84b0e24de7698704e862d
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
-rw-r--r-- | src/gui/opengl/qopenglframebufferobject.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
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) { |