summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/util
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:50 +0200
commit44dbaa1746833f2874786fc2067f8837f149261f (patch)
treedb1ccacb8fc7f24cf92f77cbf400050a74b510be /src/gallium/auxiliary/util
parent0c5df863ba27d31993f3fdc85b26407f398514fa (diff)
downloadexternal_mesa3d-44dbaa1746833f2874786fc2067f8837f149261f.zip
external_mesa3d-44dbaa1746833f2874786fc2067f8837f149261f.tar.gz
external_mesa3d-44dbaa1746833f2874786fc2067f8837f149261f.tar.bz2
u_upload_mgr: remove the return value from u_upload_data
Reviewed-by: Brian Paul <brianp@vmware.com>
Diffstat (limited to 'src/gallium/auxiliary/util')
-rw-r--r--src/gallium/auxiliary/util/u_upload_mgr.c19
-rw-r--r--src/gallium/auxiliary/util/u_upload_mgr.h12
-rw-r--r--src/gallium/auxiliary/util/u_vbuf.c9
3 files changed, 18 insertions, 22 deletions
diff --git a/src/gallium/auxiliary/util/u_upload_mgr.c b/src/gallium/auxiliary/util/u_upload_mgr.c
index 78b0f5f..59207a1 100644
--- a/src/gallium/auxiliary/util/u_upload_mgr.c
+++ b/src/gallium/auxiliary/util/u_upload_mgr.c
@@ -236,23 +236,20 @@ u_upload_alloc(struct u_upload_mgr *upload,
upload->offset = offset + alloc_size;
}
-enum pipe_error u_upload_data( struct u_upload_mgr *upload,
- unsigned min_out_offset,
- unsigned size,
- const void *data,
- unsigned *out_offset,
- struct pipe_resource **outbuf)
+void u_upload_data(struct u_upload_mgr *upload,
+ unsigned min_out_offset,
+ unsigned size,
+ const void *data,
+ unsigned *out_offset,
+ struct pipe_resource **outbuf)
{
uint8_t *ptr;
u_upload_alloc(upload, min_out_offset, size,
out_offset, outbuf,
(void**)&ptr);
- if (!outbuf)
- return PIPE_ERROR_OUT_OF_MEMORY;
-
- memcpy(ptr, data, size);
- return PIPE_OK;
+ if (ptr)
+ memcpy(ptr, data, size);
}
/* XXX: Remove. It's basically a CPU fallback of resource_copy_region. */
diff --git a/src/gallium/auxiliary/util/u_upload_mgr.h b/src/gallium/auxiliary/util/u_upload_mgr.h
index 9744dc1..67c6daa 100644
--- a/src/gallium/auxiliary/util/u_upload_mgr.h
+++ b/src/gallium/auxiliary/util/u_upload_mgr.h
@@ -92,12 +92,12 @@ void u_upload_alloc(struct u_upload_mgr *upload,
* Same as u_upload_alloc, but in addition to that, it copies "data"
* to the pointer returned from u_upload_alloc.
*/
-enum pipe_error u_upload_data( struct u_upload_mgr *upload,
- unsigned min_out_offset,
- unsigned size,
- const void *data,
- unsigned *out_offset,
- struct pipe_resource **outbuf);
+void u_upload_data(struct u_upload_mgr *upload,
+ unsigned min_out_offset,
+ unsigned size,
+ const void *data,
+ unsigned *out_offset,
+ struct pipe_resource **outbuf);
/**
diff --git a/src/gallium/auxiliary/util/u_vbuf.c b/src/gallium/auxiliary/util/u_vbuf.c
index 791d82b..3d2193c 100644
--- a/src/gallium/auxiliary/util/u_vbuf.c
+++ b/src/gallium/auxiliary/util/u_vbuf.c
@@ -976,7 +976,6 @@ u_vbuf_upload_buffers(struct u_vbuf *mgr,
unsigned start, end;
struct pipe_vertex_buffer *real_vb;
const uint8_t *ptr;
- enum pipe_error err;
i = u_bit_scan(&buffer_mask);
@@ -987,10 +986,10 @@ u_vbuf_upload_buffers(struct u_vbuf *mgr,
real_vb = &mgr->real_vertex_buffer[i];
ptr = mgr->vertex_buffer[i].user_buffer;
- err = u_upload_data(mgr->uploader, start, end - start, ptr + start,
- &real_vb->buffer_offset, &real_vb->buffer);
- if (err != PIPE_OK)
- return err;
+ u_upload_data(mgr->uploader, start, end - start, ptr + start,
+ &real_vb->buffer_offset, &real_vb->buffer);
+ if (!real_vb->buffer)
+ return PIPE_ERROR_OUT_OF_MEMORY;
real_vb->buffer_offset -= start;
}