st/egl: Fix eglCopyBuffers.
authorChia-I Wu <olv@lunarg.com>
Wed, 22 Dec 2010 06:21:21 +0000 (14:21 +0800)
committerChia-I Wu <olv@lunarg.com>
Wed, 22 Dec 2010 06:21:47 +0000 (14:21 +0800)
Flush before presenting.

src/gallium/state_trackers/egl/common/egl_g3d_api.c

index 07ea6dc8b9989c3acd4ad1c78b2e33e883d04b13..bce901ac9a95ae70fe037752bcc579a54dd7ca44 100644 (file)
@@ -665,14 +665,13 @@ egl_g3d_copy_buffers(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf,
 
    ptex = get_pipe_resource(gdpy->native, nsurf, NATIVE_ATTACHMENT_FRONT_LEFT);
    if (ptex) {
-      struct pipe_resource *psrc = gsurf->render_texture;
       struct pipe_box src_box;
+
       u_box_origin_2d(ptex->width0, ptex->height0, &src_box);
-      if (psrc) {
-         gdpy->pipe->resource_copy_region(gdpy->pipe, ptex, 0, 0, 0, 0,
-               gsurf->render_texture, 0, &src_box);
-         nsurf->present(nsurf, NATIVE_ATTACHMENT_FRONT_LEFT, FALSE, 0);
-      }
+      gdpy->pipe->resource_copy_region(gdpy->pipe, ptex, 0, 0, 0, 0,
+            gsurf->render_texture, 0, &src_box);
+      gdpy->pipe->flush(gdpy->pipe, PIPE_FLUSH_RENDER_CACHE, NULL);
+      nsurf->present(nsurf, NATIVE_ATTACHMENT_FRONT_LEFT, FALSE, 0);
 
       pipe_resource_reference(&ptex, NULL);
    }