summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Vesely <jan.vesely@rutgers.edu>2018-05-07 22:52:19 -0400
committerDylan Baker <dylan@pnwbakers.com>2018-05-08 10:07:17 -0700
commitf366968e86b65955b6b0de0dafcbb72e9925ca5d (patch)
tree1070b2e890b5e092563da7619ba78f08cb1b2559
parent227fbe2799a01ce66e7d886d4007829d4cfffc43 (diff)
r600: Cleanup constant buffers on context destruction
CC: <mesa-stable@lists.freedesktop.org> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Marek Olšák <marek.olsak@amd.com> (cherry picked from commit a1e8fcce3eafa59228bb9bb50179c04f150ca9ca)
-rw-r--r--src/gallium/drivers/r600/r600_pipe.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c
index 43f2dfae7ec..b27ab755dd8 100644
--- a/src/gallium/drivers/r600/r600_pipe.c
+++ b/src/gallium/drivers/r600/r600_pipe.c
@@ -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);
}