r600g: move updating vertex buffer state into set_vertex_buffers

This commit is contained in:
Marek Olšák 2012-04-01 23:54:44 +02:00
parent 3e3737e9e2
commit 23b948057a
2 changed files with 7 additions and 11 deletions

View file

@ -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;

View file

@ -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);