aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-01-27 02:04:27 +0100
committerMarek Olšák <[email protected]>2017-02-14 21:46:16 +0100
commitb1dc347822ce6931f8e3089f3bdfaa45dac87ebc (patch)
tree11ae4d56f05cc4e5750cd235d65cbdfe861621bd /src/gallium
parent5fe53216335fa95dc956498c3bd927b48473d9ee (diff)
gallium/vbuf: use the common uploader
Reviewed-by: Nicolai Hähnle <[email protected]> Tested-by: Edmondo Tommasina <[email protected]> Tested-by: Charmaine Lee <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/auxiliary/util/u_vbuf.c14
1 files 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);