From d1fa748cdba0b1145066186b3d634b79b5d69473 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 11 Dec 2009 11:40:52 -0700 Subject: gallium/util: added util_unreference_framebuffer_state() --- src/gallium/auxiliary/util/u_surface.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/gallium/auxiliary/util') diff --git a/src/gallium/auxiliary/util/u_surface.c b/src/gallium/auxiliary/util/u_surface.c index daaa275ef25..cfdf7ab8f8a 100644 --- a/src/gallium/auxiliary/util/u_surface.c +++ b/src/gallium/auxiliary/util/u_surface.c @@ -166,3 +166,19 @@ util_copy_framebuffer_state(struct pipe_framebuffer_state *dst, pipe_surface_reference(&dst->zsbuf, src->zsbuf); } + + +void +util_unreference_framebuffer_state(struct pipe_framebuffer_state *fb) +{ + unsigned i; + + for (i = 0; i < fb->nr_cbufs; i++) { + pipe_surface_reference(&fb->cbufs[i], NULL); + } + + pipe_surface_reference(&fb->zsbuf, NULL); + + fb->width = fb->height = 0; + fb->nr_cbufs = 0; +} -- cgit v1.2.3