diff options
author | Chia-I Wu <[email protected]> | 2010-08-25 15:11:03 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2010-08-25 16:06:45 +0800 |
commit | 22f6026324f63c142925244ff575fefc29a90389 (patch) | |
tree | 27be867272e6799cfa6d5ff153ce84e5b693a914 /src/gallium/drivers/nvfx | |
parent | 94e8d4171d9647db84cd53334a2b14fab062640d (diff) |
gallium: Use draw_set_index_buffer and others.
Update all drivers to use draw_set_index_buffer,
draw_set_mapped_index_buffer, and draw_vbo. Remove
draw_set_mapped_element_buffer and draw_set_mapped_element_buffer_range.
Diffstat (limited to 'src/gallium/drivers/nvfx')
-rw-r--r-- | src/gallium/drivers/nvfx/nvfx_draw.c | 12 | ||||
-rw-r--r-- | src/gallium/drivers/nvfx/nvfx_state_emit.c | 3 |
2 files changed, 8 insertions, 7 deletions
diff --git a/src/gallium/drivers/nvfx/nvfx_draw.c b/src/gallium/drivers/nvfx/nvfx_draw.c index 0b179212957..2601d5b8e2e 100644 --- a/src/gallium/drivers/nvfx/nvfx_draw.c +++ b/src/gallium/drivers/nvfx/nvfx_draw.c @@ -239,12 +239,10 @@ nvfx_draw_vbo_swtnl(struct pipe_context *pipe, const struct pipe_draw_info* info draw_set_mapped_vertex_buffer(nvfx->draw, i, map); } - if (info->indexed) { - map = nvfx_buffer(nvfx->idxbuf.buffer)->data + nvfx->idxbuf.offset; - draw_set_mapped_element_buffer_range(nvfx->draw, nvfx->idxbuf.index_size, info->index_bias, info->min_index, info->max_index, map); - } else { - draw_set_mapped_element_buffer(nvfx->draw, 0, 0, NULL); - } + map = NULL; + if (info->indexed && nvfx->idxbuf.buffer) + map = nvfx_buffer(nvfx->idxbuf.buffer)->data; + draw_set_mapped_index_buffer(nvfx->draw, map); if (nvfx->constbuf[PIPE_SHADER_VERTEX]) { const unsigned nr = nvfx->constbuf_nr[PIPE_SHADER_VERTEX]; @@ -254,7 +252,7 @@ nvfx_draw_vbo_swtnl(struct pipe_context *pipe, const struct pipe_draw_info* info map, nr); } - draw_arrays_instanced(nvfx->draw, info->mode, info->start, info->count, info->start_instance, info->instance_count); + draw_vbo(nvfx->draw, info); draw_flush(nvfx->draw); } diff --git a/src/gallium/drivers/nvfx/nvfx_state_emit.c b/src/gallium/drivers/nvfx/nvfx_state_emit.c index cfcb0f7ef66..390bca8cdb5 100644 --- a/src/gallium/drivers/nvfx/nvfx_state_emit.c +++ b/src/gallium/drivers/nvfx/nvfx_state_emit.c @@ -335,6 +335,9 @@ nvfx_state_validate_swtnl(struct nvfx_context *nvfx) draw_set_vertex_elements(draw, nvfx->vtxelt->num_elements, nvfx->vtxelt->pipe); } + if (nvfx->draw_dirty & NVFX_NEW_INDEX) + draw_set_index_buffer(draw, &nvfx->idxbuf); + nvfx_state_validate_common(nvfx); nvfx->draw_dirty = 0; |