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/i915 | |
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/i915')
-rw-r--r-- | src/gallium/drivers/i915/i915_context.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gallium/drivers/i915/i915_context.c b/src/gallium/drivers/i915/i915_context.c index 052a059c268..f3c7b30527c 100644 --- a/src/gallium/drivers/i915/i915_context.c +++ b/src/gallium/drivers/i915/i915_context.c @@ -53,7 +53,7 @@ i915_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info) { struct i915_context *i915 = i915_context(pipe); struct draw_context *draw = i915->draw; - void *mapped_indices = NULL; + const void *mapped_indices = NULL; /* @@ -67,8 +67,11 @@ i915_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info) /* * Map index buffer, if present */ - if (info->indexed && i915->index_buffer.buffer) - mapped_indices = i915_buffer(i915->index_buffer.buffer)->data; + if (info->indexed) { + mapped_indices = i915->index_buffer.user_buffer; + if (!mapped_indices) + mapped_indices = i915_buffer(i915->index_buffer.buffer)->data; + } draw_set_mapped_index_buffer(draw, mapped_indices); if (i915->constants[PIPE_SHADER_VERTEX]) |