aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/include/pipe/p_inlines.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/include/pipe/p_inlines.h')
-rw-r--r--src/gallium/include/pipe/p_inlines.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/gallium/include/pipe/p_inlines.h b/src/gallium/include/pipe/p_inlines.h
index de3fa555c5c..21d4827e675 100644
--- a/src/gallium/include/pipe/p_inlines.h
+++ b/src/gallium/include/pipe/p_inlines.h
@@ -97,7 +97,7 @@ pipe_buffer_reference(struct pipe_winsys *winsys,
* \sa pipe_surface_reference
*/
static INLINE void
-pipe_texture_reference(struct pipe_context *pipe, struct pipe_texture **ptr,
+pipe_texture_reference(struct pipe_texture **ptr,
struct pipe_texture *pt)
{
assert(ptr);
@@ -106,6 +106,7 @@ pipe_texture_reference(struct pipe_context *pipe, struct pipe_texture **ptr,
pt->refcount++;
if (*ptr) {
+ struct pipe_context *pipe = (*ptr)->pipe;
pipe->texture_release(pipe, ptr);
assert(!*ptr);
}
@@ -114,6 +115,17 @@ pipe_texture_reference(struct pipe_context *pipe, struct pipe_texture **ptr,
}
+static INLINE void
+pipe_texture_release(struct pipe_texture **ptr)
+{
+ struct pipe_context *pipe;
+ assert(ptr);
+ pipe = (*ptr)->pipe;
+ pipe->texture_release(pipe, ptr);
+ *ptr = NULL;
+}
+
+
#ifdef __cplusplus
}
#endif