diff options
Diffstat (limited to 'src/gallium/drivers/r600/r600_translate.c')
-rw-r--r-- | src/gallium/drivers/r600/r600_translate.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/gallium/drivers/r600/r600_translate.c b/src/gallium/drivers/r600/r600_translate.c index 1c227d32151..ba12eee2b56 100644 --- a/src/gallium/drivers/r600/r600_translate.c +++ b/src/gallium/drivers/r600/r600_translate.c @@ -42,6 +42,7 @@ void r600_begin_vertex_translate(struct r600_pipe_context *rctx) struct pipe_resource *out_buffer; unsigned i, num_verts; struct pipe_vertex_element new_velems[PIPE_MAX_ATTRIBS]; + void *tmp; /* Initialize the translate key, i.e. the recipe how vertices should be * translated. */ @@ -159,8 +160,9 @@ void r600_begin_vertex_translate(struct r600_pipe_context *rctx) } } - rctx->tran.new_velems = pipe->create_vertex_elements_state(pipe, ve->count, new_velems); - pipe->bind_vertex_elements_state(pipe, rctx->tran.new_velems); + tmp = pipe->create_vertex_elements_state(pipe, ve->count, new_velems); + pipe->bind_vertex_elements_state(pipe, tmp); + rctx->tran.new_velems = tmp; pipe_resource_reference(&out_buffer, NULL); } @@ -173,15 +175,11 @@ void r600_end_vertex_translate(struct r600_pipe_context *rctx) return; } /* Restore vertex elements. */ - if (rctx->vertex_elements == rctx->tran.new_velems) { - pipe->bind_vertex_elements_state(pipe, NULL); - } pipe->delete_vertex_elements_state(pipe, rctx->tran.new_velems); rctx->tran.new_velems = NULL; /* Delete the now-unused VBO. */ - pipe_resource_reference(&rctx->vertex_buffer[rctx->tran.vb_slot].buffer, - NULL); + pipe_resource_reference(&rctx->vertex_buffer[rctx->tran.vb_slot].buffer, NULL); } void r600_translate_index_buffer(struct r600_pipe_context *r600, |