From 752e85947c08c687c3e297bbd0e00a1a4d677cfb Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Thu, 18 Feb 2016 16:43:02 +0100 Subject: Restore multisampled FBOs on ANGLE The function resolving changes remove the special treatment for ES 3.0+ contexts, meaning that now all functions get resolved in the same way irrespective of the current context. For blitFramebuffer and renderbufferStorageMultisample this presented an issue with ANGLE. There these functions are available both as an ANGLE extension and as standard ES 3.0 functions. The latter are not functional however in 2.0 contexts. We expect multisampled FBOs to work in 2.0 contexts too by prefering the ANGLE extension with 2.0 contexts. Change-Id: I0a4b70e6d39c84d4b1f61f8fd0655d7326419a2a Reviewed-by: Lars Knoll --- src/plugins/platforms/windows/qwindowseglcontext.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/plugins/platforms/windows/qwindowseglcontext.cpp') diff --git a/src/plugins/platforms/windows/qwindowseglcontext.cpp b/src/plugins/platforms/windows/qwindowseglcontext.cpp index 87800283ee..42caeb1c89 100644 --- a/src/plugins/platforms/windows/qwindowseglcontext.cpp +++ b/src/plugins/platforms/windows/qwindowseglcontext.cpp @@ -538,7 +538,23 @@ void QWindowsEGLContext::swapBuffers(QPlatformSurface *surface) QFunctionPointer QWindowsEGLContext::getProcAddress(const char *procName) { QWindowsEGLStaticContext::libEGL.eglBindAPI(m_api); - QFunctionPointer procAddress = reinterpret_cast(QWindowsEGLStaticContext::libEGL.eglGetProcAddress(procName)); + + QFunctionPointer procAddress = nullptr; + + // Special logic for ANGLE extensions for blitFramebuffer and + // renderbufferStorageMultisample. In version 2 contexts the extensions + // must be used instead of the suffixless, version 3.0 functions. + if (m_format.majorVersion() < 3) { + if (!strcmp(procName, "glBlitFramebuffer") || !strcmp(procName, "glRenderbufferStorageMultisample")) { + char extName[32 + 5 + 1]; + strcpy(extName, procName); + strcat(extName, "ANGLE"); + procAddress = reinterpret_cast(QWindowsEGLStaticContext::libEGL.eglGetProcAddress(extName)); + } + } + + if (!procAddress) + procAddress = reinterpret_cast(QWindowsEGLStaticContext::libEGL.eglGetProcAddress(procName)); // We support AllGLFunctionsQueryable, which means this function must be able to // return a function pointer for standard GLES2 functions too. These are not -- cgit v1.2.3