gallium/svga: Make use of u_upload_flush().
authorThomas Hellstrom <thellstrom@vmware.com>
Thu, 17 Mar 2011 14:09:48 +0000 (15:09 +0100)
committerThomas Hellstrom <thellstrom@vmware.com>
Fri, 1 Jul 2011 11:30:37 +0000 (13:30 +0200)
This enables us to pack more data into single upload buffers.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
src/gallium/drivers/svga/svga_context.c
src/gallium/drivers/svga/svga_draw.c

index dbbc249258d41471ce358d1f9aedb3913fee31e7..cfb1b9d8d0d7919d8e0c3ceaf433bd682c3118ca 100644 (file)
@@ -207,6 +207,14 @@ void svga_context_flush( struct svga_context *svga,
 
    svga->curr.nr_fbs = 0;
 
+   /* Flush the upload managers to ensure recycling of upload buffers
+    * without throttling. This should really be conditioned on
+    * pipe_buffer_map_range not supporting PIPE_TRANSFER_UNSYNCHRONIZED.
+    */
+
+   u_upload_flush(svga->upload_vb);
+   u_upload_flush(svga->upload_ib);
+
    /* Ensure that texture dma uploads are processed
     * before submitting commands.
     */
index d8af615ede153a35a95bc2df4b92ee992e168119..28ba470d8c7cb94344fe2500a9ef705aecac94bc 100644 (file)
@@ -145,7 +145,7 @@ svga_hwtnl_flush( struct svga_hwtnl *hwtnl )
       unsigned i;
 
       /* Unmap upload manager vertex buffers */
-      u_upload_flush(svga->upload_vb);
+      u_upload_unmap(svga->upload_vb);
 
       for (i = 0; i < hwtnl->cmd.vdecl_count; i++) {
          handle = svga_buffer_handle(svga, hwtnl->cmd.vdecl_vb[i]);
@@ -156,7 +156,7 @@ svga_hwtnl_flush( struct svga_hwtnl *hwtnl )
       }
 
       /* Unmap upload manager index buffers */
-      u_upload_flush(svga->upload_ib);
+      u_upload_unmap(svga->upload_ib);
 
       for (i = 0; i < hwtnl->cmd.prim_count; i++) {
          if (hwtnl->cmd.prim_ib[i]) {