From 0b153bc93a9a954222fadce54da89476900b3f32 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Tue, 12 Aug 2014 10:57:45 +0200 Subject: 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 --- src/platformsupport/eglconvenience/qeglplatformcontext.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/platformsupport') diff --git a/src/platformsupport/eglconvenience/qeglplatformcontext.cpp b/src/platformsupport/eglconvenience/qeglplatformcontext.cpp index 9691d12682..148c5d9b2f 100644 --- a/src/platformsupport/eglconvenience/qeglplatformcontext.cpp +++ b/src/platformsupport/eglconvenience/qeglplatformcontext.cpp @@ -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; -- cgit v1.2.3