summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2010-04-03 07:58:34 +0200
committerKeith Whitwell <keithw@vmware.com>2010-04-09 10:53:07 +0100
commitfec8a1db13fac04ef56f6ece799d1f20aa3011db (patch)
tree418de0067c3ef6dc2bc407e0ebfd44335e521e48
parent1ff3984c2edce9927744f3cce3e7b07778990170 (diff)
util: fix assertion failures in pipe_buffer_flush_mapped_range
-rw-r--r--src/gallium/auxiliary/util/u_inlines.h2
-rw-r--r--src/gallium/auxiliary/util/u_upload_mgr.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/util/u_inlines.h b/src/gallium/auxiliary/util/u_inlines.h
index b1f2285169..f9cd4e114e 100644
--- a/src/gallium/auxiliary/util/u_inlines.h
+++ b/src/gallium/auxiliary/util/u_inlines.h
@@ -223,7 +223,7 @@ pipe_buffer_flush_mapped_range(struct pipe_context *pipe,
assert(length);
assert(transfer->box.x <= offset);
- assert(transfer->box.x + transfer->box.width <= offset + length);
+ assert(offset + length <= transfer->box.x + transfer->box.width);
/* Match old screen->buffer_flush_mapped_range() behaviour, where
* offset parameter is relative to the start of the buffer, not the
diff --git a/src/gallium/auxiliary/util/u_upload_mgr.c b/src/gallium/auxiliary/util/u_upload_mgr.c
index f8c3954815..75d44432d9 100644
--- a/src/gallium/auxiliary/util/u_upload_mgr.c
+++ b/src/gallium/auxiliary/util/u_upload_mgr.c
@@ -95,7 +95,7 @@ my_buffer_write(struct pipe_context *pipe,
assert(dirty_size >= size);
assert(size);
- map = pipe_buffer_map_range(pipe, buf, offset, size,
+ map = pipe_buffer_map_range(pipe, buf, offset, dirty_size,
PIPE_TRANSFER_WRITE |
PIPE_TRANSFER_FLUSH_EXPLICIT |
PIPE_TRANSFER_DISCARD |