diff options
author | Brian <[email protected]> | 2008-02-26 19:31:22 -0700 |
---|---|---|
committer | Brian <[email protected]> | 2008-02-26 19:31:22 -0700 |
commit | 4da19dbcaa9f3e2d20fffd0145bf0bc756dd7542 (patch) | |
tree | efd946fe548caad53bec8b64a6152c3d5f621149 /src/gallium/include/pipe | |
parent | a6044bdf74bae96f05310ad6e39942f172b8ab02 (diff) |
gallium: remove pipe parameter from pipe_texture_reference()
Added pipe field to pipe_texture (temporary, see comments).
First step toward context-less texture creation...
Diffstat (limited to 'src/gallium/include/pipe')
-rw-r--r-- | src/gallium/include/pipe/p_inlines.h | 14 | ||||
-rw-r--r-- | src/gallium/include/pipe/p_state.h | 5 |
2 files changed, 18 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 diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h index ddf3c1c79bf..25a6fcc9e63 100644 --- a/src/gallium/include/pipe/p_state.h +++ b/src/gallium/include/pipe/p_state.h @@ -296,6 +296,11 @@ struct pipe_texture /* These are also refcounted: */ unsigned refcount; + + /**< pipe that created the texture + * XXX this'll change to a pipe_winsys (or pipe_screen)... + */ + struct pipe_context *pipe; }; |