Mesa (master): u_upload_mgr: remove the return value from u_upload_buffer
Marek Olšák
mareko at kemper.freedesktop.org
Thu Sep 3 16:59:14 UTC 2015
Module: Mesa
Branch: master
Commit: 0c5df863ba27d31993f3fdc85b26407f398514fa
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=0c5df863ba27d31993f3fdc85b26407f398514fa
Author: Marek Olšák <marek.olsak at amd.com>
Date: Wed Sep 2 15:11:40 2015 +0200
u_upload_mgr: remove the return value from u_upload_buffer
Reviewed-by: Brian Paul <brianp at vmware.com>
---
src/gallium/auxiliary/util/u_upload_mgr.c | 35 +++++++++--------------------
src/gallium/auxiliary/util/u_upload_mgr.h | 14 ++++++------
2 files changed, 18 insertions(+), 31 deletions(-)
diff --git a/src/gallium/auxiliary/util/u_upload_mgr.c b/src/gallium/auxiliary/util/u_upload_mgr.c
index ff5d834..78b0f5f 100644
--- a/src/gallium/auxiliary/util/u_upload_mgr.c
+++ b/src/gallium/auxiliary/util/u_upload_mgr.c
@@ -255,21 +255,15 @@ enum pipe_error u_upload_data( struct u_upload_mgr *upload,
return PIPE_OK;
}
-
-/* As above, but upload the full contents of a buffer. Useful for
- * uploading user buffers, avoids generating an explosion of GPU
- * buffers if you have an app that does lots of small vertex buffer
- * renders or DrawElements calls.
- */
-enum pipe_error u_upload_buffer( struct u_upload_mgr *upload,
- unsigned min_out_offset,
- unsigned offset,
- unsigned size,
- struct pipe_resource *inbuf,
- unsigned *out_offset,
- struct pipe_resource **outbuf)
+/* XXX: Remove. It's basically a CPU fallback of resource_copy_region. */
+void u_upload_buffer(struct u_upload_mgr *upload,
+ unsigned min_out_offset,
+ unsigned offset,
+ unsigned size,
+ struct pipe_resource *inbuf,
+ unsigned *out_offset,
+ struct pipe_resource **outbuf)
{
- enum pipe_error ret = PIPE_OK;
struct pipe_transfer *transfer = NULL;
const char *map = NULL;
@@ -280,20 +274,13 @@ enum pipe_error u_upload_buffer( struct u_upload_mgr *upload,
&transfer);
if (map == NULL) {
- return PIPE_ERROR_OUT_OF_MEMORY;
+ pipe_resource_reference(outbuf, NULL);
+ return;
}
if (0)
debug_printf("upload ptr %p ofs %d sz %d\n", map, offset, size);
- ret = u_upload_data( upload,
- min_out_offset,
- size,
- map,
- out_offset,
- outbuf);
-
+ u_upload_data(upload, min_out_offset, size, map, out_offset, outbuf);
pipe_buffer_unmap( upload->pipe, transfer );
-
- return ret;
}
diff --git a/src/gallium/auxiliary/util/u_upload_mgr.h b/src/gallium/auxiliary/util/u_upload_mgr.h
index 2c31977..9744dc1 100644
--- a/src/gallium/auxiliary/util/u_upload_mgr.h
+++ b/src/gallium/auxiliary/util/u_upload_mgr.h
@@ -106,13 +106,13 @@ enum pipe_error u_upload_data( struct u_upload_mgr *upload,
* Same as u_upload_data, except that the input data comes from a buffer
* instead of a user pointer.
*/
-enum pipe_error u_upload_buffer( struct u_upload_mgr *upload,
- unsigned min_out_offset,
- unsigned offset,
- unsigned size,
- struct pipe_resource *inbuf,
- unsigned *out_offset,
- struct pipe_resource **outbuf);
+void u_upload_buffer(struct u_upload_mgr *upload,
+ unsigned min_out_offset,
+ unsigned offset,
+ unsigned size,
+ struct pipe_resource *inbuf,
+ unsigned *out_offset,
+ struct pipe_resource **outbuf);
More information about the mesa-commit
mailing list