diff options
author | Marek Olšák <[email protected]> | 2011-02-08 16:34:22 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2011-02-08 16:35:02 +0100 |
commit | b541a3c4c0a125087fa9e1e0d35db019c36fb0e9 (patch) | |
tree | dfb8c174ddd5518b1356aa5e0cc502ddc6c4464e | |
parent | 467023e8080489abeff53e18ac83560eaf851827 (diff) |
r300g: use the same upload buffer for vertices and indices
-rw-r--r-- | src/gallium/drivers/r300/r300_context.c | 14 | ||||
-rw-r--r-- | src/gallium/drivers/r300/r300_context.h | 3 | ||||
-rw-r--r-- | src/gallium/drivers/r300/r300_render_translate.c | 6 | ||||
-rw-r--r-- | src/gallium/drivers/r300/r300_screen_buffer.c | 2 |
4 files changed, 7 insertions, 18 deletions
diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c index 7e0c068ff3e..c6e03050fc7 100644 --- a/src/gallium/drivers/r300/r300_context.c +++ b/src/gallium/drivers/r300/r300_context.c @@ -104,8 +104,6 @@ static void r300_destroy_context(struct pipe_context* context) if (r300->vbuf_mgr) u_vbuf_mgr_destroy(r300->vbuf_mgr); - if (r300->upload_ib) - u_upload_destroy(r300->upload_ib); /* XXX: This function assumes r300->query_list was initialized */ r300_release_referenced_objects(r300); @@ -434,8 +432,9 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen, r300_init_resource_functions(r300); r300->vbuf_mgr = u_vbuf_mgr_create(&r300->context, 1024 * 1024, 16, - PIPE_BIND_VERTEX_BUFFER, - U_VERTEX_FETCH_DWORD_ALIGNED); + PIPE_BIND_VERTEX_BUFFER | + PIPE_BIND_INDEX_BUFFER, + U_VERTEX_FETCH_DWORD_ALIGNED); if (!r300->vbuf_mgr) goto fail; @@ -453,13 +452,6 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen, if (!r300_hyperz_init_mm(r300)) goto fail; - r300->upload_ib = u_upload_create(&r300->context, - 64 * 1024, 16, - PIPE_BIND_INDEX_BUFFER); - - if (r300->upload_ib == NULL) - goto fail; - r300_init_states(&r300->context); /* The KIL opcode needs the first texture unit to be enabled diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index 9d2a0b290ae..1737dafc6ac 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -579,9 +579,6 @@ struct r300_context { /* two mem block managers for hiz/zmask ram space */ struct mem_block *hiz_mm; - /* upload manager */ - struct u_upload_mgr *upload_ib; - struct u_vbuf_mgr *vbuf_mgr; 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 76d012d81e6..dbc64ebf827 100644 --- a/src/gallium/drivers/r300/r300_render_translate.c +++ b/src/gallium/drivers/r300/r300_render_translate.c @@ -37,7 +37,7 @@ void r300_translate_index_buffer(struct r300_context *r300, switch (*index_size) { case 1: - u_upload_alloc(r300->upload_ib, 0, count * 2, + u_upload_alloc(r300->vbuf_mgr->uploader, 0, count * 2, &out_offset, &out_buffer, &flushed, &ptr); util_shorten_ubyte_elts_to_userptr( @@ -52,7 +52,7 @@ void r300_translate_index_buffer(struct r300_context *r300, case 2: if (index_offset) { - u_upload_alloc(r300->upload_ib, 0, count * 2, + u_upload_alloc(r300->vbuf_mgr->uploader, 0, count * 2, &out_offset, &out_buffer, &flushed, &ptr); util_rebuild_ushort_elts_to_userptr(&r300->context, *index_buffer, @@ -67,7 +67,7 @@ void r300_translate_index_buffer(struct r300_context *r300, case 4: if (index_offset) { - u_upload_alloc(r300->upload_ib, 0, count * 4, + u_upload_alloc(r300->vbuf_mgr->uploader, 0, count * 4, &out_offset, &out_buffer, &flushed, &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 d76524d261d..4a3cc7a3f41 100644 --- a/src/gallium/drivers/r300/r300_screen_buffer.c +++ b/src/gallium/drivers/r300/r300_screen_buffer.c @@ -67,7 +67,7 @@ void r300_upload_index_buffer(struct r300_context *r300, *index_buffer = NULL; - u_upload_data(r300->upload_ib, + u_upload_data(r300->vbuf_mgr->uploader, 0, count * index_size, ptr + (*start * index_size), &index_offset, |