From 23b948057ad33cf0b27e5c88a8e9ff7dbfa0573c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sun, 1 Apr 2012 23:54:44 +0200 Subject: [PATCH] r600g: move updating vertex buffer state into set_vertex_buffers --- src/gallium/drivers/r600/r600_pipe.h | 3 ++- src/gallium/drivers/r600/r600_state_common.c | 15 +++++---------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/gallium/drivers/r600/r600_pipe.h b/src/gallium/drivers/r600/r600_pipe.h index 450fcc4ccfe..e17011bfb68 100644 --- a/src/gallium/drivers/r600/r600_pipe.h +++ b/src/gallium/drivers/r600/r600_pipe.h @@ -349,10 +349,11 @@ struct r600_context { * In that case, we bind this one: */ void *dummy_pixel_shader; - bool vertex_buffers_dirty; boolean dual_src_blend; unsigned color0_format; + /* Vertex and index buffers. */ + bool vertex_buffers_dirty; struct pipe_index_buffer index_buffer; struct pipe_vertex_buffer vertex_buffer[PIPE_MAX_ATTRIBS]; unsigned nr_vertex_buffers; diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c index b32d89b6750..75f9cdf89b9 100644 --- a/src/gallium/drivers/r600/r600_state_common.c +++ b/src/gallium/drivers/r600/r600_state_common.c @@ -398,7 +398,11 @@ void r600_set_vertex_buffers(struct pipe_context *ctx, unsigned count, struct r600_context *rctx = (struct r600_context *)ctx; util_copy_vertex_buffers(rctx->vertex_buffer, &rctx->nr_vertex_buffers, buffers, count); - rctx->vertex_buffers_dirty = true; + + r600_inval_vertex_cache(rctx); + rctx->vertex_buffer_state.num_dw = (rctx->chip_class >= EVERGREEN ? 12 : 10) * + rctx->nr_vertex_buffers; + r600_atom_dirty(rctx, &rctx->vertex_buffer_state); } void *r600_create_vertex_elements(struct pipe_context *ctx, @@ -760,15 +764,6 @@ void r600_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *dinfo) r600_update_derived_state(rctx); - /* Update vertex buffers. */ - if (rctx->vertex_buffers_dirty) { - r600_inval_vertex_cache(rctx); - rctx->vertex_buffer_state.num_dw = (rctx->chip_class >= EVERGREEN ? 12 : 10) * - rctx->nr_vertex_buffers; - r600_atom_dirty(rctx, &rctx->vertex_buffer_state); - rctx->vertex_buffers_dirty = FALSE; - } - if (info.indexed) { /* Initialize the index buffer struct. */ pipe_resource_reference(&ib.buffer, rctx->index_buffer.buffer); -- 2.30.2