summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gallium/drivers/r300/r300_context.c5
-rw-r--r--src/gallium/drivers/r300/r300_context.h1
-rw-r--r--src/gallium/drivers/r300/r300_render_translate.c6
-rw-r--r--src/gallium/drivers/r300/r300_screen_buffer.c2
4 files changed, 10 insertions, 4 deletions
diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c
index fd464f32afd..cb8cef15134 100644
--- a/src/gallium/drivers/r300/r300_context.c
+++ b/src/gallium/drivers/r300/r300_context.c
@@ -103,6 +103,8 @@ static void r300_destroy_context(struct pipe_context* context)
if (r300->vbuf_mgr)
u_vbuf_destroy(r300->vbuf_mgr);
+ u_upload_destroy(r300->uploader);
+
/* XXX: This function assumes r300->query_list was initialized */
r300_release_referenced_objects(r300);
@@ -440,6 +442,9 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen,
goto fail;
}
+ r300->uploader = u_upload_create(&r300->context, 256 * 1024, 16,
+ PIPE_BIND_INDEX_BUFFER);
+
r300->blitter = util_blitter_create(&r300->context);
if (r300->blitter == NULL)
goto fail;
diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h
index 29f27177077..8f125d19c16 100644
--- a/src/gallium/drivers/r300/r300_context.h
+++ b/src/gallium/drivers/r300/r300_context.h
@@ -580,6 +580,7 @@ struct r300_context {
struct pipe_index_buffer index_buffer;
struct pipe_vertex_buffer vertex_buffer[PIPE_MAX_ATTRIBS];
unsigned nr_vertex_buffers;
+ struct u_upload_mgr *uploader;
struct util_slab_mempool pool_transfers;
diff --git a/src/gallium/drivers/r300/r300_render_translate.c b/src/gallium/drivers/r300/r300_render_translate.c
index c2eb3c547f4..022e8a7fc70 100644
--- a/src/gallium/drivers/r300/r300_render_translate.c
+++ b/src/gallium/drivers/r300/r300_render_translate.c
@@ -36,7 +36,7 @@ void r300_translate_index_buffer(struct r300_context *r300,
switch (*index_size) {
case 1:
- u_upload_alloc(r300->vbuf_mgr->uploader, 0, count * 2,
+ u_upload_alloc(r300->uploader, 0, count * 2,
&out_offset, &out_buffer, &ptr);
util_shorten_ubyte_elts_to_userptr(
@@ -51,7 +51,7 @@ void r300_translate_index_buffer(struct r300_context *r300,
case 2:
if (index_offset) {
- u_upload_alloc(r300->vbuf_mgr->uploader, 0, count * 2,
+ u_upload_alloc(r300->uploader, 0, count * 2,
&out_offset, &out_buffer, &ptr);
util_rebuild_ushort_elts_to_userptr(&r300->context, *index_buffer,
@@ -66,7 +66,7 @@ void r300_translate_index_buffer(struct r300_context *r300,
case 4:
if (index_offset) {
- u_upload_alloc(r300->vbuf_mgr->uploader, 0, count * 4,
+ u_upload_alloc(r300->uploader, 0, count * 4,
&out_offset, &out_buffer, &ptr);
util_rebuild_uint_elts_to_userptr(&r300->context, *index_buffer,
diff --git a/src/gallium/drivers/r300/r300_screen_buffer.c b/src/gallium/drivers/r300/r300_screen_buffer.c
index c92b83146c0..d89ccebbe73 100644
--- a/src/gallium/drivers/r300/r300_screen_buffer.c
+++ b/src/gallium/drivers/r300/r300_screen_buffer.c
@@ -41,7 +41,7 @@ void r300_upload_index_buffer(struct r300_context *r300,
*index_buffer = NULL;
- u_upload_data(r300->vbuf_mgr->uploader,
+ u_upload_data(r300->uploader,
0, count * index_size,
ptr + (*start * index_size),
&index_offset,