diff options
author | marha <marha@users.sourceforge.net> | 2012-12-03 09:16:19 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-12-03 09:16:19 +0100 |
commit | 17464545a9abdd19312065a578d1f69a6b0b015f (patch) | |
tree | d39fde94a445ddde95399d4850ffbbbd357a3a19 /mesalib/src/gallium/auxiliary/util/u_inlines.h | |
parent | eba14241fe23d0561687a1e530a57fa0bfc6ab69 (diff) | |
parent | b8da71ffb17d3d16706db04115e9ba1dd8bc49b9 (diff) | |
download | vcxsrv-17464545a9abdd19312065a578d1f69a6b0b015f.tar.gz vcxsrv-17464545a9abdd19312065a578d1f69a6b0b015f.tar.bz2 vcxsrv-17464545a9abdd19312065a578d1f69a6b0b015f.zip |
Merge remote-tracking branch 'origin/released'
* origin/released:
fontconfig mesa xserver pixman xkeyboard-config git update 3 dec 2012
Diffstat (limited to 'mesalib/src/gallium/auxiliary/util/u_inlines.h')
-rw-r--r-- | mesalib/src/gallium/auxiliary/util/u_inlines.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/mesalib/src/gallium/auxiliary/util/u_inlines.h b/mesalib/src/gallium/auxiliary/util/u_inlines.h index 6ef5fecc6..cb06ee2e0 100644 --- a/mesalib/src/gallium/auxiliary/util/u_inlines.h +++ b/mesalib/src/gallium/auxiliary/util/u_inlines.h @@ -114,6 +114,22 @@ pipe_surface_reference(struct pipe_surface **ptr, struct pipe_surface *surf) *ptr = surf; } +/** + * Similar to pipe_surface_reference() but always set the pointer to NULL + * and pass in an explicit context. The explicit context avoids the problem + * of using a deleted context's surface_destroy() method when freeing a surface + * that's shared by multiple contexts. + */ +static INLINE void +pipe_surface_release(struct pipe_context *pipe, struct pipe_surface **ptr) +{ + if (pipe_reference_described(&(*ptr)->reference, NULL, + (debug_reference_descriptor)debug_describe_surface)) + pipe->surface_destroy(pipe, *ptr); + *ptr = NULL; +} + + static INLINE void pipe_resource_reference(struct pipe_resource **ptr, struct pipe_resource *tex) { |