From 33e9aeca7f004bf736820d4d38503ff4db924846 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Mon, 16 Jun 2014 10:43:20 +0200 Subject: 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 Reviewed-by: Gunnar Sletta --- src/gui/opengl/qopenglfunctions.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/gui/opengl/qopenglfunctions.cpp') 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) -- cgit v1.2.3