util: Fix typo in u_upload_flush().
authorJosé Fonseca <jfonseca@vmware.com>
Fri, 11 Mar 2011 11:28:53 +0000 (11:28 +0000)
committerJosé Fonseca <jfonseca@vmware.com>
Fri, 11 Mar 2011 11:54:26 +0000 (11:54 +0000)
upload->offset is how much we used. upload->size is the whole buffer size.

src/gallium/auxiliary/util/u_upload_mgr.c

index dcf800a1e8e9e5733c361a42884b3324d7ab5a8b..9562acb821024f4db40e6b41a166dc884bb331c5 100644 (file)
@@ -85,9 +85,9 @@ void u_upload_flush( struct u_upload_mgr *upload )
 {
    /* Unmap and unreference the upload buffer. */
    if (upload->transfer) {
-      if (upload->size) {
+      if (upload->offset) {
          pipe_buffer_flush_mapped_range(upload->pipe, upload->transfer,
-                                        0, upload->size);
+                                        0, upload->offset);
       }
       pipe_transfer_unmap(upload->pipe, upload->transfer);
       pipe_transfer_destroy(upload->pipe, upload->transfer);