summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/util
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-12-11 11:40:52 -0700
committerBrian Paul <[email protected]>2009-12-11 11:40:52 -0700
commitd1fa748cdba0b1145066186b3d634b79b5d69473 (patch)
tree245e4a7a8f3a7f435c3a230c623af1c77145c452 /src/gallium/auxiliary/util
parent8f2a1736635368951c3f30e484ee6137066964d6 (diff)
gallium/util: added util_unreference_framebuffer_state()
Diffstat (limited to 'src/gallium/auxiliary/util')
-rw-r--r--src/gallium/auxiliary/util/u_surface.c16
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 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;
+}