Make sure to have a pbuffer-capable config for the temp pbuffer

The temporary pbuffer has to have a config that is pbuffer capable.
Otherwise the makeCurrent() can potentially fail with drivers that
strictly differentiate between the different configurations.

Change-Id: Id63f52da5c5a1308072b1f1bb4b297ea6a547166
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
This commit is contained in:
Laszlo Agocs 2014-08-12 10:57:45 +02:00
parent 12ce167a96
commit 0b153bc93a

View File

@ -256,7 +256,11 @@ void QEGLPlatformContext::updateFormatFromGL()
EGL_LARGEST_PBUFFER, EGL_FALSE,
EGL_NONE
};
EGLSurface pbuffer = eglCreatePbufferSurface(m_eglDisplay, m_eglConfig, pbufferAttributes);
// Cannot just pass m_eglConfig because it may not be suitable for pbuffers. Instead,
// do what QEGLPbuffer would do: request a config with the same attributes but with
// PBUFFER_BIT set.
EGLConfig config = q_configFromGLFormat(m_eglDisplay, m_format, false, EGL_PBUFFER_BIT);
EGLSurface pbuffer = eglCreatePbufferSurface(m_eglDisplay, config, pbufferAttributes);
if (pbuffer == EGL_NO_SURFACE)
return;