radeonsi: unreference framebuffer state with set_framebuffer_state
authorMarek Olšák <marek.olsak@amd.com>
Tue, 21 Jun 2016 13:52:03 +0000 (15:52 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 29 Jun 2016 18:12:00 +0000 (20:12 +0200)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_pipe.c
src/gallium/drivers/radeonsi/si_state.c
src/gallium/drivers/radeonsi/si_state.h

index 633d4bb7a5292ed9b695e75938a4456d6903f8be..6c88fe381f4f867bd984c4a6cdf887405b9d15f5 100644 (file)
@@ -43,7 +43,11 @@ static void si_destroy_context(struct pipe_context *context)
        struct si_context *sctx = (struct si_context *)context;
        int i;
 
-       si_dec_framebuffer_counters(&sctx->framebuffer.state);
+       /* Unreference the framebuffer normally to disable related logic
+        * properly.
+        */
+       struct pipe_framebuffer_state fb = {};
+       context->set_framebuffer_state(context, &fb);
 
        si_release_all_descriptors(sctx);
 
@@ -79,7 +83,6 @@ static void si_destroy_context(struct pipe_context *context)
                sctx->b.b.delete_blend_state(&sctx->b.b, sctx->custom_blend_fastclear);
        if (sctx->custom_blend_dcc_decompress)
                sctx->b.b.delete_blend_state(&sctx->b.b, sctx->custom_blend_dcc_decompress);
-       util_unreference_framebuffer_state(&sctx->framebuffer.state);
 
        if (sctx->blitter)
                util_blitter_destroy(sctx->blitter);
index cec5e84ad8208cdf7f6abf458c0a338fb1d4d54f..6db65be382fe5e8cd970f6cc2a9d85ec519892d6 100644 (file)
@@ -2209,7 +2209,7 @@ static void si_init_depth_surface(struct si_context *sctx,
        surf->depth_initialized = true;
 }
 
-void si_dec_framebuffer_counters(const struct pipe_framebuffer_state *state)
+static void si_dec_framebuffer_counters(const struct pipe_framebuffer_state *state)
 {
        for (int i = 0; i < state->nr_cbufs; ++i) {
                struct r600_surface *surf = NULL;
index 9361849f78144fe5055f4e8a4411a927752f5c0b..05654bbb2e44543ae249650e87fe006426755dc4 100644 (file)
@@ -332,7 +332,6 @@ si_create_sampler_view_custom(struct pipe_context *ctx,
                              const struct pipe_sampler_view *state,
                              unsigned width0, unsigned height0,
                              unsigned force_level);
-void si_dec_framebuffer_counters(const struct pipe_framebuffer_state *state);
 
 /* si_state_shader.c */
 bool si_update_shaders(struct si_context *sctx);