nvfx: properly unreference bound objects on context destruction

This commit is contained in:
Luca Barbieri
2010-08-09 05:05:12 +02:00
parent e189823eb4
commit 6a73d99a52
+8
View File
@@ -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);