const __DRIconfig *config,
void *loaderPrivate,
int pixmap);
- int64_t (*swapBuffers)(__DRIdrawable *draw);
+ /* flags is a set of __DRI2_FLUSH_* flags */
+ int64_t (*swapBuffers)(__DRIdrawable *draw, uint32_t flush_flags);
void (*setSwapInterval)(__DRIdrawable *drawable, int interval);
int (*queryBufferAge)(__DRIdrawable *drawable);
};
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(draw);
if (dri2_dpy->kopper) {
- dri2_dpy->kopper->swapBuffers(dri2_surf->dri_drawable);
+ /* From the EGL 1.4 spec (page 52):
+ *
+ * "The contents of ancillary buffers are always undefined
+ * after calling eglSwapBuffers."
+ */
+ dri2_dpy->kopper->swapBuffers(dri2_surf->dri_drawable, __DRI2_FLUSH_INVALIDATE_ANCILLARY);
return EGL_TRUE;
} else if (!dri2_dpy->flush) {
/* aka the swrast path, which does the swap in the gallium driver. */
}
static int64_t
-kopperSwapBuffers(__DRIdrawable *dPriv)
+kopperSwapBuffers(__DRIdrawable *dPriv, uint32_t flush_flags)
{
struct dri_drawable *drawable = dri_drawable(dPriv);
struct dri_context *ctx = dri_get_current();
drawable->texture_stamp = drawable->lastStamp - 1;
dri_flush(opaque_dri_context(ctx), opaque_dri_drawable(drawable),
- __DRI2_FLUSH_DRAWABLE | __DRI2_FLUSH_CONTEXT,
+ __DRI2_FLUSH_DRAWABLE | __DRI2_FLUSH_CONTEXT | flush_flags,
__DRI2_THROTTLE_SWAPBUFFER);
kopper_copy_to_front(ctx->st->pipe, drawable, ptex);
static void
kopper_swap_buffers(struct dri_drawable *drawable)
{
- kopperSwapBuffers(opaque_dri_drawable(drawable));
+ kopperSwapBuffers(opaque_dri_drawable(drawable), 0);
}
static __DRIdrawable *
}
if (psc->kopper)
- return psc->kopper->swapBuffers (pdp->driDrawable);
+ return psc->kopper->swapBuffers (pdp->driDrawable, 0);
psc->core->swapBuffers(pdp->driDrawable);