summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2010-12-27 22:32:31 +0100
committerMarek Olšák <[email protected]>2011-01-06 16:16:29 +0100
commit06286110b4fc0ff80ae21bb3d8ff9909db1f5d47 (patch)
tree9f2fbb63c1ea124ad6c84560b19f3ec999d5d8de /src/gallium/drivers/r300
parent8b7bd3ce8875f5028bbf234d107f56d595a0d0b7 (diff)
u_upload_mgr: new features
- Added a parameter to specify a minimum offset that should be returned. r300g needs this to better implement user buffer uploads. This weird requirement comes from the fact that the Radeon DRM doesn't support negative offsets. - Added a parameter to notify a driver that the upload flush occured. A driver may skip buffer validation if there was no flush, resulting in a better performance. - Added a new upload function that returns a pointer to the upload buffer directly, so that the buffer can be filled e.g. by the translate module.
Diffstat (limited to 'src/gallium/drivers/r300')
-rw-r--r--src/gallium/drivers/r300/r300_screen_buffer.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gallium/drivers/r300/r300_screen_buffer.c b/src/gallium/drivers/r300/r300_screen_buffer.c
index f96998195af..11ad87ed89b 100644
--- a/src/gallium/drivers/r300/r300_screen_buffer.c
+++ b/src/gallium/drivers/r300/r300_screen_buffer.c
@@ -62,15 +62,16 @@ void r300_upload_index_buffer(struct r300_context *r300,
unsigned count)
{
unsigned index_offset;
+ boolean flushed;
uint8_t *ptr = r300_buffer(*index_buffer)->user_buffer;
*index_buffer = NULL;
u_upload_data(r300->upload_ib,
- count * index_size,
+ 0, count * index_size,
ptr + (*start * index_size),
&index_offset,
- index_buffer);
+ index_buffer, &flushed);
*start = index_offset / index_size;
}
@@ -78,6 +79,7 @@ void r300_upload_index_buffer(struct r300_context *r300,
void r300_upload_user_buffers(struct r300_context *r300)
{
int i, nr = r300->velems->count;
+ boolean flushed;
for (i = 0; i < nr; i++) {
struct pipe_vertex_buffer *vb =
@@ -85,9 +87,9 @@ void r300_upload_user_buffers(struct r300_context *r300)
if (r300_buffer_is_user_buffer(vb->buffer)) {
u_upload_data(r300->upload_vb,
- vb->buffer->width0,
+ 0, vb->buffer->width0,
r300_buffer(vb->buffer)->user_buffer,
- &vb->buffer_offset, &vb->buffer);
+ &vb->buffer_offset, &vb->buffer, &flushed);
r300->validate_buffers = TRUE;
r300->vertex_arrays_dirty = TRUE;