aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/gallium/auxiliary/util/u_upload_mgr.c
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/gallium/auxiliary/util/u_upload_mgr.c')
-rw-r--r--mesalib/src/gallium/auxiliary/util/u_upload_mgr.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/mesalib/src/gallium/auxiliary/util/u_upload_mgr.c b/mesalib/src/gallium/auxiliary/util/u_upload_mgr.c
index a2319d0c4..b4b4c91f1 100644
--- a/mesalib/src/gallium/auxiliary/util/u_upload_mgr.c
+++ b/mesalib/src/gallium/auxiliary/util/u_upload_mgr.c
@@ -158,7 +158,6 @@ enum pipe_error u_upload_alloc( struct u_upload_mgr *upload,
unsigned size,
unsigned *out_offset,
struct pipe_resource **outbuf,
- boolean *flushed,
void **ptr )
{
unsigned alloc_size = align( size, upload->alignment );
@@ -172,10 +171,6 @@ enum pipe_error u_upload_alloc( struct u_upload_mgr *upload,
alloc_offset + alloc_size);
if (ret != PIPE_OK)
return ret;
-
- *flushed = TRUE;
- } else {
- *flushed = FALSE;
}
offset = MAX2(upload->offset, alloc_offset);
@@ -192,6 +187,8 @@ enum pipe_error u_upload_alloc( struct u_upload_mgr *upload,
*ptr = NULL;
return PIPE_ERROR_OUT_OF_MEMORY;
}
+
+ upload->map -= offset;
}
assert(offset < upload->buffer->width0);
@@ -212,12 +209,11 @@ enum pipe_error u_upload_data( struct u_upload_mgr *upload,
unsigned size,
const void *data,
unsigned *out_offset,
- struct pipe_resource **outbuf,
- boolean *flushed )
+ struct pipe_resource **outbuf)
{
uint8_t *ptr;
enum pipe_error ret = u_upload_alloc(upload, min_out_offset, size,
- out_offset, outbuf, flushed,
+ out_offset, outbuf,
(void**)&ptr);
if (ret != PIPE_OK)
return ret;
@@ -238,8 +234,7 @@ enum pipe_error u_upload_buffer( struct u_upload_mgr *upload,
unsigned size,
struct pipe_resource *inbuf,
unsigned *out_offset,
- struct pipe_resource **outbuf,
- boolean *flushed )
+ struct pipe_resource **outbuf)
{
enum pipe_error ret = PIPE_OK;
struct pipe_transfer *transfer = NULL;
@@ -261,9 +256,9 @@ enum pipe_error u_upload_buffer( struct u_upload_mgr *upload,
ret = u_upload_data( upload,
min_out_offset,
size,
- map + offset,
+ map,
out_offset,
- outbuf, flushed );
+ outbuf);
pipe_buffer_unmap( upload->pipe, transfer );