From b1dc347822ce6931f8e3089f3bdfaa45dac87ebc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Fri, 27 Jan 2017 02:04:27 +0100 Subject: [PATCH] gallium/vbuf: use the common uploader MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Nicolai Hähnle Tested-by: Edmondo Tommasina Tested-by: Charmaine Lee --- src/gallium/auxiliary/util/u_vbuf.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/gallium/auxiliary/util/u_vbuf.c b/src/gallium/auxiliary/util/u_vbuf.c index 532e7c004bf..c26a923c7f3 100644 --- a/src/gallium/auxiliary/util/u_vbuf.c +++ b/src/gallium/auxiliary/util/u_vbuf.c @@ -146,7 +146,6 @@ struct u_vbuf { struct pipe_context *pipe; struct translate_cache *translate_cache; struct cso_cache *cso_cache; - struct u_upload_mgr *uploader; /* This is what was set in set_vertex_buffers. * May contain user buffers. */ @@ -314,10 +313,6 @@ u_vbuf_create(struct pipe_context *pipe, mgr->translate_cache = translate_cache_create(); memset(mgr->fallback_vbs, ~0, sizeof(mgr->fallback_vbs)); - mgr->uploader = u_upload_create(pipe, 1024 * 1024, - PIPE_BIND_VERTEX_BUFFER, - PIPE_USAGE_STREAM); - return mgr; } @@ -390,7 +385,6 @@ void u_vbuf_destroy(struct u_vbuf *mgr) pipe_resource_reference(&mgr->aux_vertex_buffer_saved.buffer, NULL); translate_cache_destroy(mgr->translate_cache); - u_upload_destroy(mgr->uploader); cso_cache_delete(mgr->cso_cache); FREE(mgr); } @@ -454,7 +448,7 @@ u_vbuf_translate_buffers(struct u_vbuf *mgr, struct translate_key *key, assert((ib->buffer || ib->user_buffer) && ib->index_size); /* Create and map the output buffer. */ - u_upload_alloc(mgr->uploader, 0, + u_upload_alloc(mgr->pipe->stream_uploader, 0, key->output_stride * num_indices, 4, &out_offset, &out_buffer, (void**)&out_map); @@ -486,7 +480,7 @@ u_vbuf_translate_buffers(struct u_vbuf *mgr, struct translate_key *key, } } else { /* Create and map the output buffer. */ - u_upload_alloc(mgr->uploader, + u_upload_alloc(mgr->pipe->stream_uploader, key->output_stride * start_vertex, key->output_stride * num_vertices, 4, &out_offset, &out_buffer, @@ -990,7 +984,7 @@ u_vbuf_upload_buffers(struct u_vbuf *mgr, real_vb = &mgr->real_vertex_buffer[i]; ptr = mgr->vertex_buffer[i].user_buffer; - u_upload_data(mgr->uploader, start, end - start, 4, ptr + start, + u_upload_data(mgr->pipe->stream_uploader, start, end - start, 4, ptr + start, &real_vb->buffer_offset, &real_vb->buffer); if (!real_vb->buffer) return PIPE_ERROR_OUT_OF_MEMORY; @@ -1295,7 +1289,7 @@ void u_vbuf_draw_vbo(struct u_vbuf *mgr, const struct pipe_draw_info *info) } */ - u_upload_unmap(mgr->uploader); + u_upload_unmap(pipe->stream_uploader); u_vbuf_set_driver_vertex_buffers(mgr); pipe->draw_vbo(pipe, &new_info); -- 2.30.2