radeonsi: avoid stale state pointers
authorChristian König <christian.koenig@amd.com>
Sat, 8 Mar 2014 13:18:30 +0000 (14:18 +0100)
committerChristian König <christian.koenig@amd.com>
Sat, 8 Mar 2014 15:08:15 +0000 (16:08 +0100)
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/radeonsi/si_pipe.c

index ff11a67b7b1734edb07f767d7f2c53318457e5e1..ac9e49a9cb8b1a9ba3f6947ec70264aa0a50cfa6 100644 (file)
@@ -83,15 +83,9 @@ static void si_destroy_context(struct pipe_context *context)
        pipe_resource_reference(&sctx->null_const_buf.buffer, NULL);
        r600_resource_reference(&sctx->border_color_table, NULL);
 
-       if (sctx->gs_on) {
-               si_pm4_free_state(sctx, sctx->gs_on, 0);
-       }
-       if (sctx->gs_off) {
-               si_pm4_free_state(sctx, sctx->gs_off, 0);
-       }
-       if (sctx->gs_rings) {
-               si_pm4_free_state(sctx, sctx->gs_rings, 0);
-       }
+       si_pm4_delete_state(sctx, gs_rings, sctx->gs_rings);
+       si_pm4_delete_state(sctx, gs_onoff, sctx->gs_on);
+       si_pm4_delete_state(sctx, gs_onoff, sctx->gs_off);
 
        if (sctx->dummy_pixel_shader) {
                sctx->b.b.delete_fs_state(&sctx->b.b, sctx->dummy_pixel_shader);