summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2010-09-20 10:44:44 +1000
committerDave Airlie <airlied@redhat.com>2010-09-20 10:44:44 +1000
commit040411de267bd6b0d82a621430cbbbb943fd455a (patch)
tree5700d3470534bdae2adbdeccc4bf9290c620890d
parent4af55364ccb50e4f19cbb59ac6f51d86f58dedba (diff)
r600g: clean up valgrind issues on maxtargets test.
-rw-r--r--src/gallium/drivers/r600/r600_state.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gallium/drivers/r600/r600_state.c b/src/gallium/drivers/r600/r600_state.c
index e347943873..2b97c2a94e 100644
--- a/src/gallium/drivers/r600/r600_state.c
+++ b/src/gallium/drivers/r600/r600_state.c
@@ -382,10 +382,16 @@ static void r600_set_framebuffer_state(struct pipe_context *ctx,
struct r600_context_state *rstate;
int i;
- r600_context_state_decref(rctx->framebuffer);
+ if (rctx->framebuffer) {
+ for (i = 0; i < rctx->framebuffer->state.framebuffer.nr_cbufs; i++)
+ radeon_draw_unbind(&rctx->draw, &rctx->framebuffer->rstate[i+1]);
+ radeon_draw_unbind(&rctx->draw, &rctx->framebuffer->rstate[0]);
+ }
clean_flush(rctx, &rctx->hw_states.cb_flush);
clean_flush(rctx, &rctx->hw_states.db_flush);
+ r600_context_state_decref(rctx->framebuffer);
+
rstate = r600_new_context_state(pipe_framebuffer_type);
rstate->state.framebuffer = *state;
for (i = 0; i < rstate->state.framebuffer.nr_cbufs; i++) {