diff options
author | Marek Olšák <[email protected]> | 2012-04-24 17:04:18 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2012-04-30 01:09:57 +0200 |
commit | 8c655f499cf61211146a3d38f77532541f88aa88 (patch) | |
tree | d8d8fb0d988ac9832793b970e499a075a8b47c5d /src/mesa/state_tracker/st_draw.c | |
parent | 989bdaab514cce808eea4b9d792656aaeee8603c (diff) |
st/mesa: make user index buffers optional
v2: use a separate upload buffer for indices
Diffstat (limited to 'src/mesa/state_tracker/st_draw.c')
-rw-r--r-- | src/mesa/state_tracker/st_draw.c | 5 |
1 files changed, 5 insertions, 0 deletions
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 = |