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/nv30 | |
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/nv30')
-rw-r--r-- | src/gallium/drivers/nv30/nv30_draw.c | 6 | ||||
-rw-r--r-- | src/gallium/drivers/nv30/nv30_screen.c | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/gallium/drivers/nv30/nv30_draw.c b/src/gallium/drivers/nv30/nv30_draw.c index c6907fa806f..29e63953838 100644 --- a/src/gallium/drivers/nv30/nv30_draw.c +++ b/src/gallium/drivers/nv30/nv30_draw.c @@ -412,7 +412,9 @@ nv30_render_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info) } if (info->indexed) { - void *map = pipe_buffer_map(pipe, nv30->idxbuf.buffer, + const void *map = nv30->idxbuf.user_buffer; + if (!map) + pipe_buffer_map(pipe, nv30->idxbuf.buffer, PIPE_TRANSFER_UNSYNCHRONIZED | PIPE_TRANSFER_READ, &transferi); draw_set_index_buffer(draw, &nv30->idxbuf); @@ -424,7 +426,7 @@ nv30_render_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info) draw_vbo(draw, info); draw_flush(draw); - if (info->indexed) + if (info->indexed && transferi) pipe_buffer_unmap(pipe, transferi); for (i = 0; i < nv30->num_vtxbufs; i++) if (transfer[i]) diff --git a/src/gallium/drivers/nv30/nv30_screen.c b/src/gallium/drivers/nv30/nv30_screen.c index 5d550d13b5e..c3e50a58316 100644 --- a/src/gallium/drivers/nv30/nv30_screen.c +++ b/src/gallium/drivers/nv30/nv30_screen.c @@ -78,9 +78,9 @@ nv30_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param) case PIPE_CAP_TGSI_FS_COORD_ORIGIN_LOWER_LEFT: case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_HALF_INTEGER: case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER: - case PIPE_CAP_USER_INDEX_BUFFERS: case PIPE_CAP_USER_CONSTANT_BUFFERS: return 1; + case PIPE_CAP_USER_INDEX_BUFFERS: case PIPE_CAP_USER_VERTEX_BUFFERS: return 0; case PIPE_CAP_CONSTANT_BUFFER_OFFSET_ALIGNMENT: |