summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/util/u_surface.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-12-11 11:39:53 -0700
committerBrian Paul <[email protected]>2009-12-11 11:39:55 -0700
commit8f2a1736635368951c3f30e484ee6137066964d6 (patch)
treea0f9331deaaf29bcdffee58c3971ff5c15b4a310 /src/gallium/auxiliary/util/u_surface.c
parent205da96fc64a197b7d1a15010456402030d8893b (diff)
gallium/util: simplify util_framebuffer_state_equal()
And copy width, height in util_copy_framebuffer_state().
Diffstat (limited to 'src/gallium/auxiliary/util/u_surface.c')
-rw-r--r--src/gallium/auxiliary/util/u_surface.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/gallium/auxiliary/util/u_surface.c b/src/gallium/auxiliary/util/u_surface.c
index a95b887e847..daaa275ef25 100644
--- a/src/gallium/auxiliary/util/u_surface.c
+++ b/src/gallium/auxiliary/util/u_surface.c
@@ -122,24 +122,27 @@ boolean
util_framebuffer_state_equal(const struct pipe_framebuffer_state *dst,
const struct pipe_framebuffer_state *src)
{
- boolean changed = FALSE;
unsigned i;
+ if (dst->width != src->width ||
+ dst->height != src->height)
+ return FALSE;
+
for (i = 0; i < Elements(src->cbufs); i++) {
if (dst->cbufs[i] != src->cbufs[i]) {
- changed = TRUE;
+ return FALSE;
}
}
if (dst->nr_cbufs != src->nr_cbufs) {
- changed = TRUE;
+ return FALSE;
}
if (dst->zsbuf != src->zsbuf) {
- changed = TRUE;
+ return FALSE;
}
- return changed;
+ return TRUE;
}
@@ -152,6 +155,9 @@ util_copy_framebuffer_state(struct pipe_framebuffer_state *dst,
{
unsigned i;
+ dst->width = src->width;
+ dst->height = src->height;
+
for (i = 0; i < Elements(src->cbufs); i++) {
pipe_surface_reference(&dst->cbufs[i], src->cbufs[i]);
}