Mesa (lp-binning): gallium/util: added util_unreference_framebuffer_state()

Brian Paul brianp at kemper.freedesktop.org
Fri Dec 11 17:01:20 PST 2009


Module: Mesa
Branch: lp-binning
Commit: d1fa748cdba0b1145066186b3d634b79b5d69473
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d1fa748cdba0b1145066186b3d634b79b5d69473

Author: Brian Paul <brianp at vmware.com>
Date:   Fri Dec 11 11:40:52 2009 -0700

gallium/util: added util_unreference_framebuffer_state()

---

 src/gallium/auxiliary/util/u_surface.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_surface.c b/src/gallium/auxiliary/util/u_surface.c
index daaa275..cfdf7ab 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;
+}



More information about the mesa-commit mailing list