summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/p_inlines.h
diff options
context:
space:
mode:
authorMichel Dänzer <michel@tungstengraphics.com>2007-11-30 20:48:03 +0100
committerBen Skeggs <skeggsb@gmail.com>2007-12-09 12:05:25 +1100
commit274603c5c9553a13c44c6e3d48ac73c280cd3b64 (patch)
treefc07548b9a4ed54a1fde91e55fcd409513ff6afd /src/mesa/pipe/p_inlines.h
parent6f44a21348cb70601fc138150bb603fa527d6b63 (diff)
Hide texture layout details from the state tracker.
pipe->get_tex_surface() has to be used for access to texture image data.
Diffstat (limited to 'src/mesa/pipe/p_inlines.h')
-rw-r--r--src/mesa/pipe/p_inlines.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/mesa/pipe/p_inlines.h b/src/mesa/pipe/p_inlines.h
index 2418d016e1..c04d46dddd 100644
--- a/src/mesa/pipe/p_inlines.h
+++ b/src/mesa/pipe/p_inlines.h
@@ -80,4 +80,24 @@ pipe_surface_reference(struct pipe_surface **ptr, struct pipe_surface *surf)
}
}
+
+/**
+ * \sa pipe_region_reference
+ */
+static INLINE void
+pipe_texture_reference(struct pipe_context *pipe, struct pipe_texture **ptr,
+ struct pipe_texture *pt)
+{
+ assert(ptr);
+ if (*ptr) {
+ pipe->texture_release(pipe, ptr);
+ assert(!*ptr);
+ }
+ if (pt) {
+ /* reference the new thing */
+ pt->refcount++;
+ *ptr = pt;
+ }
+}
+
#endif /* P_INLINES_H */