summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-08-06 09:02:05 -0600
committerBrian Paul <[email protected]>2009-08-06 09:47:13 -0600
commitffb1f9bded52aa9f53ed179f91186c9e8c59b8c8 (patch)
tree7c29cd769fb8884cf0a625fe7481f0ca9932e989 /src/gallium
parent8c223e8eb6359d5df918e23ae5c036fa134cc40d (diff)
util: added util_same_surface() helper function
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/auxiliary/util/u_surface.h17
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 a5b73cfc20a..ce84ed7ad06 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,