Commit 62c49f5d by Corentin Wallez

PbufferSurfaceGLX: avoid creating (0, 0)-sized pbuffers

It crashes on Mesa. BUG=angleproject:1188 Change-Id: I1e1e3e696bfda0c127b683a620cbaf302087e43b Reviewed-on: https://chromium-review.googlesource.com/309630Tested-by: 's avatarCorentin Wallez <cwallez@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 5d91dda9
......@@ -43,10 +43,16 @@ PbufferSurfaceGLX::~PbufferSurfaceGLX()
egl::Error PbufferSurfaceGLX::initialize()
{
// Avoid creating 0-sized PBuffers as it fails on the Intel Mesa driver
// as commented on https://bugs.freedesktop.org/show_bug.cgi?id=38869 so we
// use (w, 1) or (1, h) instead.
int width = std::max(1, static_cast<int>(mWidth));
int height = std::max(1, static_cast<int>(mHeight));
const int attribs[] =
{
GLX_PBUFFER_WIDTH, static_cast<int>(mWidth),
GLX_PBUFFER_HEIGHT, static_cast<int>(mHeight),
GLX_PBUFFER_WIDTH, width,
GLX_PBUFFER_HEIGHT, height,
GLX_LARGEST_PBUFFER, mLargest,
None
};
......
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