gallium: fix/update tex target dumping
[mesa.git] / src / gallium / auxiliary / util / u_surface.h
index a5b73cfc20aba5fce59f1e3c5acd457b11c5956f..c43169b5278552ddc2b19ff81b28288f0e068710 100644 (file)
 
 
 #include "pipe/p_compiler.h"
+#include "pipe/p_state.h"
+
+
+/**
+ * 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);
+}
 
 
-struct pipe_screen;
-struct pipe_texture;
-struct pipe_surface;
 
 
 extern boolean
 util_create_rgba_surface(struct pipe_screen *screen,
-                         uint width, uint height,
-                         struct pipe_texture **textureOut,
+                         uint width, uint height, uint bind,
+                         struct pipe_resource **textureOut,
                          struct pipe_surface **surfaceOut);
 
 
 extern void
-util_destroy_rgba_surface(struct pipe_texture *texture,
+util_destroy_rgba_surface(struct pipe_resource *texture,
                           struct pipe_surface *surface);
 
 
+
+extern void
+util_surface_copy(struct pipe_context *pipe,
+                  boolean do_flip,
+                  struct pipe_surface *dst,
+                  unsigned dst_x, unsigned dst_y,
+                  struct pipe_surface *src,
+                  unsigned src_x, unsigned src_y, 
+                  unsigned w, unsigned h);
+
+extern void
+util_surface_fill(struct pipe_context *pipe,
+                  struct pipe_surface *dst,
+                  unsigned dstx, unsigned dsty,
+                  unsigned width, unsigned height, unsigned value);
+
+
+
 #endif /* U_SURFACE_H */