summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowseglcontext.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2016-02-18 16:43:02 +0100
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>2016-03-02 12:16:27 +0000
commit752e85947c08c687c3e297bbd0e00a1a4d677cfb (patch)
tree18b9119101107489faa2ae4a7c6e726f554adb8e /src/plugins/platforms/windows/qwindowseglcontext.cpp
parent696dc4f6dfcac6b2bbc6c874408cb9127f5abdf1 (diff)
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 <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowseglcontext.cpp')
-rw-r--r--src/plugins/platforms/windows/qwindowseglcontext.cpp18
1 files changed, 17 insertions, 1 deletions
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<QFunctionPointer>(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<QFunctionPointer>(QWindowsEGLStaticContext::libEGL.eglGetProcAddress(extName));
+ }
+ }
+
+ if (!procAddress)
+ procAddress = reinterpret_cast<QFunctionPointer>(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