r600: Cleanup constant buffers on context destruction
authorJan Vesely <jan.vesely@rutgers.edu>
Tue, 8 May 2018 02:52:19 +0000 (22:52 -0400)
committerJan Vesely <jan.vesely@rutgers.edu>
Tue, 8 May 2018 13:02:30 +0000 (09:02 -0400)
CC: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/r600/r600_pipe.c

index 102e75035f9d7754ef460de34f0bf4ac7bdfbc00..1a293ea69870c7e4f55bb1d3eb3c65baf099b5d2 100644 (file)
@@ -65,7 +65,7 @@ static const struct debug_named_value r600_debug_options[] = {
 static void r600_destroy_context(struct pipe_context *context)
 {
        struct r600_context *rctx = (struct r600_context *)context;
-       unsigned sh;
+       unsigned sh, i;
 
        r600_isa_destroy(rctx->isa);
 
@@ -104,6 +104,10 @@ static void r600_destroy_context(struct pipe_context *context)
        }
        util_unreference_framebuffer_state(&rctx->framebuffer.state);
 
+       for (sh = 0; sh < PIPE_SHADER_TYPES; ++sh)
+               for (i = 0; i < PIPE_MAX_CONSTANT_BUFFERS; ++i)
+                       rctx->b.b.set_constant_buffer(context, sh, i, NULL);
+
        if (rctx->blitter) {
                util_blitter_destroy(rctx->blitter);
        }