Commit e3f3cf7b by Corentin Wallez

DisplayGLX: make the dummy pbuffer of size (1, 1)

This works around a Mesa crasher bug. BUG=angleproject:1188 Change-Id: Ief7e6e841715cc04dea696bc1919d7a2d6fbc78d Reviewed-on: https://chromium-review.googlesource.com/309141 Tryjob-Request: Corentin Wallez <cwallez@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Tested-by: 's avatarCorentin Wallez <cwallez@chromium.org>
parent c8947ea2
...@@ -146,11 +146,20 @@ egl::Error DisplayGLX::initialize(egl::Display *display) ...@@ -146,11 +146,20 @@ egl::Error DisplayGLX::initialize(egl::Display *display)
// FunctionsGL and DisplayGL need to make a few GL calls, for example to // FunctionsGL and DisplayGL need to make a few GL calls, for example to
// query the version of the context so we need to make the context current. // query the version of the context so we need to make the context current.
// glXMakeCurrent requires a GLXDrawable so we create a temporary Pbuffer // glXMakeCurrent requires a GLXDrawable so we create a temporary Pbuffer
// (of size 0, 0) for the duration of these calls. // (of size 1, 1) for the duration of these calls.
// Ideally we would want to unset the current context and destroy the pbuffer
// to query things like limits. Ideally we would want to unset the current context // before going back to the application but this is TODO
// and destroy the pbuffer before going back to the application but this is TODO // We could use a pbuffer of size (0, 0) but it fails on the Intel Mesa driver
mDummyPbuffer = mGLX.createPbuffer(mContextConfig, nullptr); // as commented on https://bugs.freedesktop.org/show_bug.cgi?id=38869 so we
// use (1, 1) instead.
int dummyPbufferAttribs[] =
{
GLX_PBUFFER_WIDTH, 1,
GLX_PBUFFER_HEIGHT, 1,
None,
};
mDummyPbuffer = mGLX.createPbuffer(mContextConfig, dummyPbufferAttribs);
if (!mDummyPbuffer) if (!mDummyPbuffer)
{ {
return egl::Error(EGL_NOT_INITIALIZED, "Could not create the dummy pbuffer."); return egl::Error(EGL_NOT_INITIALIZED, "Could not create the dummy pbuffer.");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment