summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_draw.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-01-27 02:20:04 +0100
committerMarek Olšák <[email protected]>2017-02-14 21:46:16 +0100
commit1e20112abd83e6fb2697f2e81aff00ab3fc443fe (patch)
treec26c06a0883adb620457e0938d8c041404d979ff /src/mesa/state_tracker/st_draw.c
parentd3de8e1096662d6e0865db5724e550e5f42a36fa (diff)
st/mesa: use the common uploader (v2)
v2: use const_uploader Reviewed-by: Nicolai Hähnle <[email protected]> Tested-by: Edmondo Tommasina <[email protected]> (v1) Tested-by: Charmaine Lee <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker/st_draw.c')
-rw-r--r--src/mesa/state_tracker/st_draw.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c
index c1a1d2d1419..8d54732eb55 100644
--- a/src/mesa/state_tracker/st_draw.c
+++ b/src/mesa/state_tracker/st_draw.c
@@ -105,16 +105,16 @@ setup_index_buffer(struct st_context *st,
ibuffer->buffer = st_buffer_object(bufobj)->buffer;
ibuffer->offset = pointer_to_offset(ib->ptr);
}
- else if (st->indexbuf_uploader) {
+ else if (!st->has_user_indexbuf) {
/* upload indexes from user memory into a real buffer */
- u_upload_data(st->indexbuf_uploader, 0,
+ u_upload_data(st->pipe->stream_uploader, 0,
ib->count * ibuffer->index_size, 4, ib->ptr,
&ibuffer->offset, &ibuffer->buffer);
if (!ibuffer->buffer) {
/* out of memory */
return FALSE;
}
- u_upload_unmap(st->indexbuf_uploader);
+ u_upload_unmap(st->pipe->stream_uploader);
}
else {
/* indices are in user space memory */
@@ -277,7 +277,7 @@ st_draw_vbo(struct gl_context *ctx,
}
}
- if (ib && st->indexbuf_uploader && !_mesa_is_bufferobj(ib->obj)) {
+ if (ib && !st->has_user_indexbuf && !_mesa_is_bufferobj(ib->obj)) {
pipe_resource_reference(&ibuffer.buffer, NULL);
}
}
@@ -418,7 +418,8 @@ st_draw_quad(struct st_context *st,
vb.stride = sizeof(struct st_util_vertex);
- u_upload_alloc(st->uploader, 0, 4 * sizeof(struct st_util_vertex), 4,
+ u_upload_alloc(st->pipe->stream_uploader, 0,
+ 4 * sizeof(struct st_util_vertex), 4,
&vb.buffer_offset, &vb.buffer, (void **) &verts);
if (!vb.buffer) {
return false;
@@ -468,7 +469,7 @@ st_draw_quad(struct st_context *st,
verts[3].s = s0;
verts[3].t = t1;
- u_upload_unmap(st->uploader);
+ u_upload_unmap(st->pipe->stream_uploader);
/* At the time of writing, cso_get_aux_vertex_buffer_slot() always returns
* zero. If that ever changes we need to audit the calls to that function