summaryrefslogtreecommitdiff
path: root/src/gallium/winsys
diff options
context:
space:
mode:
authorChia-I Wu <olvaffe@gmail.com>2009-08-05 16:07:39 -0600
committerBrian Paul <brianp@vmware.com>2009-08-05 16:07:39 -0600
commit0153614cb0ce52e5b2321de73ad6cd73e106bb34 (patch)
treede9504f5e2e8322bd8d9d06864b7a81c46121fe0 /src/gallium/winsys
parent54a7115fc27c640e2b3f1a362e8e07aac220556d (diff)
egl_softpipe: Flush when switching current context.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r--src/gallium/winsys/egl_xlib/egl_xlib.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gallium/winsys/egl_xlib/egl_xlib.c b/src/gallium/winsys/egl_xlib/egl_xlib.c
index 2acfbf86fb..1ea4b72cd9 100644
--- a/src/gallium/winsys/egl_xlib/egl_xlib.c
+++ b/src/gallium/winsys/egl_xlib/egl_xlib.c
@@ -425,10 +425,14 @@ xlib_eglMakeCurrent(_EGLDriver *drv, EGLDisplay dpy,
struct xlib_egl_context *context = lookup_context(ctx);
struct xlib_egl_surface *draw_surf = lookup_surface(draw);
struct xlib_egl_surface *read_surf = lookup_surface(read);
+ struct st_context *oldctx = st_get_current();
if (!_eglMakeCurrent(drv, dpy, draw, read, context))
return EGL_FALSE;
+ /* Flush before switching context. Check client API? */
+ if (oldctx)
+ st_flush(oldctx, PIPE_FLUSH_RENDER_CACHE | PIPE_FLUSH_FRAME, NULL);
st_make_current((context ? context->Context : NULL),
(draw_surf ? draw_surf->Framebuffer : NULL),
(read_surf ? read_surf->Framebuffer : NULL));