summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-01-27 02:01:38 +0100
committerMarek Olšák <[email protected]>2017-02-14 21:46:16 +0100
commit8a845859519e5594a62c38b55b76f7483b7fb932 (patch)
treeb9cf770dbe33fef17ca2ae77f72988668f35c491
parent9f78ec39e9ede1a03e81c4eea610e61fe54c6902 (diff)
gallium/primconvert: use the common uploader
Reviewed-by: Nicolai Hähnle <[email protected]> Tested-by: Edmondo Tommasina <[email protected]> Tested-by: Charmaine Lee <[email protected]>
-rw-r--r--src/gallium/auxiliary/indices/u_primconvert.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/gallium/auxiliary/indices/u_primconvert.c b/src/gallium/auxiliary/indices/u_primconvert.c
index 5effd883f67..2bdfade8a54 100644
--- a/src/gallium/auxiliary/indices/u_primconvert.c
+++ b/src/gallium/auxiliary/indices/u_primconvert.c
@@ -56,7 +56,6 @@ struct primconvert_context
struct pipe_index_buffer saved_ib;
uint32_t primtypes_mask;
unsigned api_pv;
- struct u_upload_mgr *upload;
};
@@ -74,8 +73,6 @@ util_primconvert_create(struct pipe_context *pipe, uint32_t primtypes_mask)
void
util_primconvert_destroy(struct primconvert_context *pc)
{
- if (pc->upload)
- u_upload_destroy(pc->upload);
util_primconvert_save_index_buffer(pc, NULL);
FREE(pc);
}
@@ -152,12 +149,7 @@ util_primconvert_draw_vbo(struct primconvert_context *pc,
&gen_func);
}
- if (!pc->upload) {
- pc->upload = u_upload_create(pc->pipe, 4096, PIPE_BIND_INDEX_BUFFER,
- PIPE_USAGE_STREAM);
- }
-
- u_upload_alloc(pc->upload, 0, new_ib.index_size * new_info.count, 4,
+ u_upload_alloc(pc->pipe->stream_uploader, 0, new_ib.index_size * new_info.count, 4,
&new_ib.offset, &new_ib.buffer, &dst);
if (info->indexed) {
@@ -170,7 +162,7 @@ util_primconvert_draw_vbo(struct primconvert_context *pc,
if (src_transfer)
pipe_buffer_unmap(pc->pipe, src_transfer);
- u_upload_unmap(pc->upload);
+ u_upload_unmap(pc->pipe->stream_uploader);
/* bind new index buffer: */
pc->pipe->set_index_buffer(pc->pipe, &new_ib);