This fixes piglit glx-swap-singlebuffer (but not glx-swap-pixmap, which hits a BadMatch elsewhere that I haven't tracked down), and the original bug report of glean clipFlat, which was trying to do exactly this.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=32589 --- hw/xfree86/dri2/dri2.c | 18 ++++++++++++++++-- 1 files changed, 16 insertions(+), 2 deletions(-) diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c index 9ca378f..571f7cf 100644 --- a/hw/xfree86/dri2/dri2.c +++ b/hw/xfree86/dri2/dri2.c @@ -802,9 +802,23 @@ DRI2SwapBuffers(ClientPtr client, DrawablePtr pDraw, CARD64 target_msc, if (pPriv->buffers[i]->attachment == DRI2BufferBackLeft) pSrcBuffer = (DRI2BufferPtr) pPriv->buffers[i]; } - if (pSrcBuffer == NULL || pDestBuffer == NULL) { + + /* From the GLX 1.4 specification page 34 (page 40 of the PDF): + * + * This operation is a no-op if draw was created with a + * non-double-buffered GLXFBConfig, or if draw is a GLXPixmap. + * + * We interpret this as "anything with no backbuffer does nothing + * for glXSwapBuffers(). See piglit glx-swap-pixmap and + * glx-swap-singlebuffer. + */ + if (pSrcBuffer == NULL) { + return Success; + } + + if (pDestBuffer == NULL) { xf86DrvMsg(pScreen->myNum, X_ERROR, - "[DRI2] %s: drawable has no back or front?\n", __func__); + "[DRI2] %s: drawable has no front?\n", __func__); return BadDrawable; } -- 1.7.5.1 _______________________________________________ [email protected]: X.Org support Archives: http://lists.freedesktop.org/archives/xorg Info: http://lists.freedesktop.org/mailman/listinfo/xorg Your subscription address: [email protected]
