r600g/sb: improve optimization of conditional instructions
[mesa.git] / src / gallium / drivers / svga / svga_pipe_clear.c
index ddee9ee5d7322e7f54f5a8eaff891d1af136122e..47f6258302661c8f4b93e931ca9395544964ba70 100644 (file)
@@ -71,7 +71,7 @@ try_clear(struct svga_context *svga,
       if (buffers & PIPE_CLEAR_DEPTH)
          flags |= SVGA3D_CLEAR_DEPTH;
 
-      if ((svga->curr.framebuffer.zsbuf->format == PIPE_FORMAT_S8_USCALED_Z24_UNORM) &&
+      if ((svga->curr.framebuffer.zsbuf->format == PIPE_FORMAT_S8_UINT_Z24_UNORM) &&
           (buffers & PIPE_CLEAR_STENCIL))
          flags |= SVGA3D_CLEAR_STENCIL;
 
@@ -86,7 +86,7 @@ try_clear(struct svga_context *svga,
          return ret;
    }
 
-   ret = SVGA3D_ClearRect(svga->swc, flags, uc.ui, depth, stencil,
+   ret = SVGA3D_ClearRect(svga->swc, flags, uc.ui, (float) depth, stencil,
                           rect.x, rect.y, rect.w, rect.h);
    if (ret != PIPE_OK)
       return ret;
@@ -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) {