From 6a73d99a5236eeb822e9bdd26bd669638cf036c6 Mon Sep 17 00:00:00 2001 From: Luca Barbieri Date: Mon, 9 Aug 2010 05:05:12 +0200 Subject: nvfx: properly unreference bound objects on context destruction --- src/gallium/drivers/nvfx/nvfx_context.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/gallium/drivers/nvfx/nvfx_context.c') diff --git a/src/gallium/drivers/nvfx/nvfx_context.c b/src/gallium/drivers/nvfx/nvfx_context.c index 7218abff22..3d45f5f0ba 100644 --- a/src/gallium/drivers/nvfx/nvfx_context.c +++ b/src/gallium/drivers/nvfx/nvfx_context.c @@ -1,5 +1,6 @@ #include "draw/draw_context.h" #include "pipe/p_defines.h" +#include "util/u_framebuffer.h" #include "nvfx_context.h" #include "nvfx_screen.h" @@ -31,6 +32,13 @@ nvfx_destroy(struct pipe_context *pipe) { struct nvfx_context *nvfx = nvfx_context(pipe); + for(unsigned i = 0; i < nvfx->vtxbuf_nr; ++i) + pipe_resource_reference(&nvfx->vtxbuf[i].buffer, 0); + pipe_resource_reference(&nvfx->idxbuf.buffer, 0); + util_unreference_framebuffer_state(&nvfx->framebuffer); + for(unsigned i = 0; i < PIPE_MAX_SAMPLERS; ++i) + pipe_sampler_view_reference(&nvfx->fragment_sampler_views[i], 0); + if (nvfx->draw) draw_destroy(nvfx->draw); FREE(nvfx); -- cgit v1.2.3