diff options
-rw-r--r-- | src/mesa/pipe/p_context.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mesa/pipe/p_context.h b/src/mesa/pipe/p_context.h index 23961f4b8f5..b5dd149603c 100644 --- a/src/mesa/pipe/p_context.h +++ b/src/mesa/pipe/p_context.h @@ -248,6 +248,17 @@ pipe_surface_reference(struct pipe_surface **dst, struct pipe_surface *src) } } +static INLINE void +pipe_surface_unreference(struct pipe_surface **ps) +{ + assert(*ps); + (*ps)->refcount--; + if ((*ps)->refcount <= 0) { + /* XXX need a proper surface->free method */ + free(*ps); + } + *ps = NULL; +} #endif /* PIPE_CONTEXT_H */ |