diff options
author | Marek Olšák <[email protected]> | 2012-04-24 21:14:44 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2012-04-30 01:14:28 +0200 |
commit | bf469f4edc60bd1c5fd770cb231b8d5ab801427f (patch) | |
tree | 74a5142a56ed68728d35cba02283e5f118ec6ea3 /src/gallium/drivers/softpipe | |
parent | 43995c9470dd38cf80a60a169f5875de6798863f (diff) |
gallium: add void *user_buffer in pipe_index_buffer
Adapted drivers: i915, llvmpipe, r300, r600, radeonsi, softpipe.
User index buffers have been disabled in nv30, nv50, nvc0 and svga to keep
things working.
Diffstat (limited to 'src/gallium/drivers/softpipe')
-rw-r--r-- | src/gallium/drivers/softpipe/sp_draw_arrays.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gallium/drivers/softpipe/sp_draw_arrays.c b/src/gallium/drivers/softpipe/sp_draw_arrays.c index f2ffe590f85..7a2274565d5 100644 --- a/src/gallium/drivers/softpipe/sp_draw_arrays.c +++ b/src/gallium/drivers/softpipe/sp_draw_arrays.c @@ -61,7 +61,7 @@ softpipe_draw_vbo(struct pipe_context *pipe, { struct softpipe_context *sp = softpipe_context(pipe); struct draw_context *draw = sp->draw; - void *mapped_indices = NULL; + const void *mapped_indices = NULL; unsigned i; if (!softpipe_check_render_cond(sp)) @@ -84,8 +84,11 @@ softpipe_draw_vbo(struct pipe_context *pipe, } /* Map index buffer, if present */ - if (info->indexed && sp->index_buffer.buffer) - mapped_indices = softpipe_resource(sp->index_buffer.buffer)->data; + if (info->indexed) { + mapped_indices = sp->index_buffer.user_buffer; + if (!mapped_indices) + mapped_indices = softpipe_resource(sp->index_buffer.buffer)->data; + } draw_set_mapped_index_buffer(draw, mapped_indices); |