summaryrefslogtreecommitdiffstats
path: root/src/gallium/include/pipe/p_inlines.h
diff options
context:
space:
mode:
authorBen Skeggs <[email protected]>2008-02-29 13:24:31 +1100
committerBen Skeggs <[email protected]>2008-02-29 13:24:31 +1100
commit8c77e6f674206ef34ab15026b08e495209dcd4ea (patch)
tree7d21d99eee6970b340bc7a3afedeadfc99dd5745 /src/gallium/include/pipe/p_inlines.h
parent68ef52886263690632552ae187a4673945c2ab74 (diff)
parentebe3b34ad225e320a09bb4069ce4d24808386327 (diff)
Merge branch 'upstream-gallium-0.1' into nouveau-gallium-0.1
Diffstat (limited to 'src/gallium/include/pipe/p_inlines.h')
-rw-r--r--src/gallium/include/pipe/p_inlines.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/gallium/include/pipe/p_inlines.h b/src/gallium/include/pipe/p_inlines.h
index de3fa555c5c..274f76a383f 100644
--- a/src/gallium/include/pipe/p_inlines.h
+++ b/src/gallium/include/pipe/p_inlines.h
@@ -30,6 +30,7 @@
#include "p_context.h"
#include "p_defines.h"
+#include "p_screen.h"
#include "p_winsys.h"
@@ -97,7 +98,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,7 +107,10 @@ pipe_texture_reference(struct pipe_context *pipe, struct pipe_texture **ptr,
pt->refcount++;
if (*ptr) {
- pipe->texture_release(pipe, ptr);
+ struct pipe_screen *screen = (*ptr)->screen;
+ assert(screen);
+ screen->texture_release(screen, ptr);
+
assert(!*ptr);
}
@@ -114,6 +118,17 @@ pipe_texture_reference(struct pipe_context *pipe, struct pipe_texture **ptr,
}
+static INLINE void
+pipe_texture_release(struct pipe_texture **ptr)
+{
+ struct pipe_screen *screen;
+ assert(ptr);
+ screen = (*ptr)->screen;
+ screen->texture_release(screen, ptr);
+ *ptr = NULL;
+}
+
+
#ifdef __cplusplus
}
#endif