OSDN Git Service

svga: flush drawing before clearing
authorBrian Paul <brianp@vmware.com>
Wed, 18 Apr 2012 14:31:45 +0000 (08:31 -0600)
committerBrian Paul <brianp@vmware.com>
Wed, 18 Apr 2012 14:34:48 +0000 (08:34 -0600)
We don't normally clear immediately after drawing something.  But as it
was, the drawing would incorrectly appear after the clear.

Fixes piglit clear-varray-2.0 failure.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
src/gallium/drivers/svga/svga_pipe_clear.c

index 89a66f6..d2fcdd3 100644 (file)
@@ -115,6 +115,9 @@ svga_clear(struct pipe_context *pipe, unsigned buffers,
       SVGA_DBG(DEBUG_DMA, "clear sid %p\n",
                svga_surface(svga->curr.framebuffer.cbufs[0])->handle);
 
+   /* flush any queued prims (don't want them to appear after the clear!) */
+   svga_hwtnl_flush_retry(svga);
+
    ret = try_clear( svga, buffers, color, depth, stencil );
 
    if (ret == PIPE_ERROR_OUT_OF_MEMORY) {