From 8c655f499cf61211146a3d38f77532541f88aa88 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Tue, 24 Apr 2012 17:04:18 +0200 Subject: st/mesa: make user index buffers optional v2: use a separate upload buffer for indices --- src/mesa/state_tracker/st_draw.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/mesa/state_tracker/st_draw.c') diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c index c24ae75a2a9..fa7c18895c7 100644 --- a/src/mesa/state_tracker/st_draw.c +++ b/src/mesa/state_tracker/st_draw.c @@ -61,6 +61,7 @@ #include "util/u_format.h" #include "util/u_prim.h" #include "util/u_draw_quad.h" +#include "util/u_upload_mgr.h" #include "draw/draw_context.h" #include "cso_cache/cso_context.h" @@ -645,6 +646,10 @@ setup_index_buffer(struct st_context *st, pipe_resource_reference(&ibuffer->buffer, stobj->buffer); ibuffer->offset = pointer_to_offset(ib->ptr); } + else if (st->indexbuf_uploader) { + u_upload_data(st->indexbuf_uploader, 0, ib->count * ibuffer->index_size, + ib->ptr, &ibuffer->offset, &ibuffer->buffer); + } else { /* indices are in user space memory */ ibuffer->buffer = -- cgit v1.2.3