summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r600/r600_translate.c
diff options
context:
space:
mode:
authorJerome Glisse <[email protected]>2010-12-14 13:50:46 -0500
committerJerome Glisse <[email protected]>2010-12-14 13:50:46 -0500
commit54773415f407678eb9728ac347cc8302e2d76c74 (patch)
tree48aea2c5306ee0c4c6d3229e552351ea394249f4 /src/gallium/drivers/r600/r600_translate.c
parent4d1b2df6c0fd837828fdebc0bd20d9eccf1ffedf (diff)
r600g: fix segfault when translating vertex buffer
Note the support for non float vertex draw likely regressed need to find what we want to do there. candidates for 7.10 branches Signed-off-by: Jerome Glisse <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600/r600_translate.c')
-rw-r--r--src/gallium/drivers/r600/r600_translate.c12
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,