summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@digia.com>2014-06-16 10:43:20 +0200
committerLaszlo Agocs <laszlo.agocs@digia.com>2014-06-25 16:23:56 +0200
commit33e9aeca7f004bf736820d4d38503ff4db924846 (patch)
tree2786dfbec7187617a448b70c51bc90deeafeec19
parent79bbef7588cb0d819624034df9526b85b88a7294 (diff)
Support framebuffer blit and msaa without extensions on GLES3
Call the standard functions directly in GLES 3.0+ builds. The catch here, just like with the mapBuffer changes, is that we could, in theory, dynamically load a GLES3 implementation on the !QT_OPENGL_ES_3 path too. However this is limited to Windows currently and we don't have a full GLES3 stack there (yet), and even when we do get it, the ANGLE extensions for blit and multisampling will still work. Therefore this isn't really an issue for now. Task-number: QTBUG-38168 Task-number: QTBUG-39187 Change-Id: I343a737218c9fe438ee1603b37e93f0400d952a5 Reviewed-by: Andrew Knight <andrew.knight@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
-rw-r--r--src/gui/opengl/qopenglfunctions.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gui/opengl/qopenglfunctions.cpp b/src/gui/opengl/qopenglfunctions.cpp
index e38aec846e..57590cfece 100644
--- a/src/gui/opengl/qopenglfunctions.cpp
+++ b/src/gui/opengl/qopenglfunctions.cpp
@@ -395,6 +395,8 @@ static int qt_gl_resolve_extensions()
extensions |= QOpenGLExtensions::FramebufferBlit;
if (extensionMatcher.match("GL_NV_framebuffer_multisample"))
extensions |= QOpenGLExtensions::FramebufferMultisample;
+ if (format.majorVersion() >= 3)
+ extensions |= QOpenGLExtensions::FramebufferBlit | QOpenGLExtensions::FramebufferMultisample;
} else {
extensions |= QOpenGLExtensions::ElementIndexUint | QOpenGLExtensions::MapBuffer;
@@ -3178,16 +3180,24 @@ static void QOPENGLF_APIENTRY qopenglfResolveBlitFramebuffer(GLint srcX0, GLint
GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
GLbitfield mask, GLenum filter)
{
+#ifdef QT_OPENGL_ES_3
+ ::glBlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
+#else
RESOLVE_FUNC_VOID(ResolveEXT | ResolveANGLE | ResolveNV, BlitFramebuffer)
(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
+#endif
}
static void QOPENGLF_APIENTRY qopenglfResolveRenderbufferStorageMultisample(GLenum target, GLsizei samples,
GLenum internalFormat,
GLsizei width, GLsizei height)
{
+#ifdef QT_OPENGL_ES_3
+ ::glRenderbufferStorageMultisample(target, samples, internalFormat, width, height);
+#else
RESOLVE_FUNC_VOID(ResolveEXT | ResolveANGLE | ResolveNV, RenderbufferStorageMultisample)
(target, samples, internalFormat, width, height);
+#endif
}
static void QOPENGLF_APIENTRY qopenglfResolveGetBufferSubData(GLenum target, qopengl_GLintptr offset, qopengl_GLsizeiptr size, GLvoid *data)