if (rctx->vertex_elements == NULL || !rctx->nvertex_buffer)
return;
- /* delete previous translated vertex elements */
- if (rctx->tran.new_velems) {
- r600_end_vertex_translate(rctx);
- }
-
if (rctx->vertex_elements->incompatible_layout) {
/* translate rebind new vertex elements so
* return once translated
if (rctx->vertex_elements == NULL || !rctx->nvertex_buffer)
return;
- /* delete previous translated vertex elements */
- if (rctx->tran.new_velems) {
- r600_end_vertex_translate(rctx);
- }
-
if (rctx->vertex_elements->incompatible_layout) {
/* translate rebind new vertex elements so
* return once translated
{
struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
struct r600_drawl draw;
- boolean translate = FALSE;
memset(&draw, 0, sizeof(struct r600_drawl));
draw.ctx = ctx;
}
r600_draw_common(&draw);
- if (translate)
- r600_end_vertex_translate(rctx);
-
pipe_resource_reference(&draw.index_buffer, NULL);
}
struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
struct r600_vertex_element *v = (struct r600_vertex_element*)state;
+ /* delete previous translated vertex elements */
+ if (rctx->tran.new_velems) {
+ r600_end_vertex_translate(rctx);
+ }
+
rctx->vertex_elements = v;
if (v) {
rctx->states[v->rstate.id] = &v->rstate;
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. */
}
}
- 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);
}
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,