summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r600/r600_draw.c
diff options
context:
space:
mode:
authorJerome Glisse <[email protected]>2010-09-02 11:32:32 -0400
committerJerome Glisse <[email protected]>2010-09-02 11:47:30 -0400
commite73c5501b2fe20290d1b691c85a5d82ac3a0431c (patch)
tree2f23b848a81709e9063841c0b36fe3352a0c009a /src/gallium/drivers/r600/r600_draw.c
parentc9039fdb167865547dc9b3828d69b99209344999 (diff)
r600g: fix memory/bo leak
Signed-off-by: Jerome Glisse <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600/r600_draw.c')
-rw-r--r--src/gallium/drivers/r600/r600_draw.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gallium/drivers/r600/r600_draw.c b/src/gallium/drivers/r600/r600_draw.c
index 9cc26bbadad..fabd337d239 100644
--- a/src/gallium/drivers/r600/r600_draw.c
+++ b/src/gallium/drivers/r600/r600_draw.c
@@ -94,6 +94,9 @@ static int r600_draw_common(struct r600_draw *draw)
radeon_draw_bind(&rctx->draw, &rctx->vs_shader->rstate[0]);
radeon_draw_bind(&rctx->draw, &rctx->ps_shader->rstate[0]);
+ for (i = 0 ; i < rctx->vs_nresource; i++) {
+ radeon_state_fini(&rctx->vs_resource[i]);
+ }
for (i = 0 ; i < rctx->vertex_elements->count; i++) {
vs_resource = &rctx->vs_resource[i];
j = rctx->vertex_elements->elements[i].vertex_buffer_index;
@@ -120,6 +123,7 @@ static int r600_draw_common(struct r600_draw *draw)
}
radeon_draw_bind(&rctx->draw, vs_resource);
}
+ rctx->vs_nresource = rctx->vertex_elements->count;
/* FIXME start need to change winsys */
radeon_state_init(&draw->draw, rscreen->rw, R600_STATE_DRAW, 0, 0);
draw->draw.states[R600_DRAW__VGT_NUM_INDICES] = draw->count;