summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2015-09-02 15:11:40 +0200
committerMarek Olšák <marek.olsak@amd.com>2015-09-03 18:14:43 +0200
commitb4f7639955b6c74436db6dea9174a8c7ce37ec62 (patch)
treea1055e28c58cd01e62b12538245104f272360a1f
parent8c6ff05517137ab9d96015783fcf1bf9d8d1fa12 (diff)
downloadexternal_mesa3d-b4f7639955b6c74436db6dea9174a8c7ce37ec62.zip
external_mesa3d-b4f7639955b6c74436db6dea9174a8c7ce37ec62.tar.gz
external_mesa3d-b4f7639955b6c74436db6dea9174a8c7ce37ec62.tar.bz2
u_upload_mgr: remove the return value from u_upload_alloc_buffer
Reviewed-by: Brian Paul <brianp@vmware.com>
-rw-r--r--src/gallium/auxiliary/util/u_upload_mgr.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/gallium/auxiliary/util/u_upload_mgr.c b/src/gallium/auxiliary/util/u_upload_mgr.c
index 7826b61..ff5d834 100644
--- a/src/gallium/auxiliary/util/u_upload_mgr.c
+++ b/src/gallium/auxiliary/util/u_upload_mgr.c
@@ -129,9 +129,9 @@ void u_upload_destroy( struct u_upload_mgr *upload )
}
-static enum pipe_error
-u_upload_alloc_buffer( struct u_upload_mgr *upload,
- unsigned min_size )
+static void
+u_upload_alloc_buffer(struct u_upload_mgr *upload,
+ unsigned min_size)
{
struct pipe_screen *screen = upload->pipe->screen;
struct pipe_resource buffer;
@@ -161,9 +161,8 @@ u_upload_alloc_buffer( struct u_upload_mgr *upload,
}
upload->buffer = screen->resource_create(screen, &buffer);
- if (upload->buffer == NULL) {
- return PIPE_ERROR_OUT_OF_MEMORY;
- }
+ if (upload->buffer == NULL)
+ return;
/* Map the new buffer. */
upload->map = pipe_buffer_map_range(upload->pipe, upload->buffer,
@@ -172,11 +171,10 @@ u_upload_alloc_buffer( struct u_upload_mgr *upload,
if (upload->map == NULL) {
upload->transfer = NULL;
pipe_resource_reference(&upload->buffer, NULL);
- return PIPE_ERROR_OUT_OF_MEMORY;
+ return;
}
upload->offset = 0;
- return PIPE_OK;
}
void
@@ -195,9 +193,9 @@ u_upload_alloc(struct u_upload_mgr *upload,
/* Make sure we have enough space in the upload buffer
* for the sub-allocation. */
if (unlikely(MAX2(upload->offset, alloc_offset) + alloc_size > buffer_size)) {
- enum pipe_error ret = u_upload_alloc_buffer(upload,
- alloc_offset + alloc_size);
- if (unlikely(ret != PIPE_OK)) {
+ u_upload_alloc_buffer(upload, alloc_offset + alloc_size);
+
+ if (unlikely(!upload->buffer)) {
*out_offset = ~0;
pipe_resource_reference(outbuf, NULL);
*ptr = NULL;