radeonsi: release NIR in the right place to fix crashes
authorMarek Olšák <marek.olsak@amd.com>
Thu, 25 Jul 2019 01:49:36 +0000 (21:49 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 31 Jul 2019 02:06:23 +0000 (22:06 -0400)
src/gallium/drivers/radeonsi/si_compute.c

index 4d701e1b81fc63d433e248bc1000f230bbeae832..360b5a1b5108cda24e15e6fc08fc2feb2c5dc90b 100644 (file)
@@ -953,6 +953,7 @@ void si_destroy_compute(struct si_compute *program)
        }
 
        si_shader_destroy(&program->shader);
+       ralloc_free(program->sel.nir);
        FREE(program);
 }
 
@@ -969,7 +970,6 @@ static void si_delete_compute_state(struct pipe_context *ctx, void* state){
        if (program == sctx->cs_shader_state.emitted_program)
                sctx->cs_shader_state.emitted_program = NULL;
 
-       ralloc_free(program->sel.nir);
        si_compute_reference(&program, NULL);
 }