Mesa (mesa_7_5_branch): util: added util_same_surface() helper function

Brian Paul brianp at kemper.freedesktop.org
Thu Aug 6 15:50:15 UTC 2009


Module: Mesa
Branch: mesa_7_5_branch
Commit: ffb1f9bded52aa9f53ed179f91186c9e8c59b8c8
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ffb1f9bded52aa9f53ed179f91186c9e8c59b8c8

Author: Brian Paul <brianp at vmware.com>
Date:   Thu Aug  6 09:02:05 2009 -0600

util: added util_same_surface() helper function

---

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

diff --git a/src/gallium/auxiliary/util/u_surface.h b/src/gallium/auxiliary/util/u_surface.h
index a5b73cf..ce84ed7 100644
--- a/src/gallium/auxiliary/util/u_surface.h
+++ b/src/gallium/auxiliary/util/u_surface.h
@@ -37,6 +37,23 @@ struct pipe_texture;
 struct pipe_surface;
 
 
+/**
+ * Are s1 and s2 the same surface?
+ * Surfaces are basically views into textures so check if the two surfaces
+ * name the same part of the same texture.
+ */
+static INLINE boolean
+util_same_surface(const struct pipe_surface *s1, const struct pipe_surface *s2)
+{
+   return (s1->texture == s2->texture &&
+           s1->face == s2->face &&
+           s1->level == s2->level &&
+           s1->zslice == s2->zslice);
+}
+
+
+
+
 extern boolean
 util_create_rgba_surface(struct pipe_screen *screen,
                          uint width, uint height,




More information about the mesa-commit mailing list