diff options
author | marha <marha@users.sourceforge.net> | 2012-02-24 08:16:00 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-02-24 08:16:00 +0100 |
commit | 5fb4fb602bde5140dcea45464e3b70a49078ad2e (patch) | |
tree | 24db226b5f69e9a8c9c3aea11e7a27a82620fa2c /mesalib/src/gallium/auxiliary/util/u_inlines.h | |
parent | 6baac61e6ca9cd314e689dfe7f84771aad08c66e (diff) | |
download | vcxsrv-5fb4fb602bde5140dcea45464e3b70a49078ad2e.tar.gz vcxsrv-5fb4fb602bde5140dcea45464e3b70a49078ad2e.tar.bz2 vcxsrv-5fb4fb602bde5140dcea45464e3b70a49078ad2e.zip |
fontconfig libX11 pixman xserver git update 24 Feb 2012
Diffstat (limited to 'mesalib/src/gallium/auxiliary/util/u_inlines.h')
-rw-r--r-- | mesalib/src/gallium/auxiliary/util/u_inlines.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/mesalib/src/gallium/auxiliary/util/u_inlines.h b/mesalib/src/gallium/auxiliary/util/u_inlines.h index c90dc5707..2fe680ff4 100644 --- a/mesalib/src/gallium/auxiliary/util/u_inlines.h +++ b/mesalib/src/gallium/auxiliary/util/u_inlines.h @@ -135,6 +135,28 @@ pipe_sampler_view_reference(struct pipe_sampler_view **ptr, struct pipe_sampler_ *ptr = view; } +/** + * Similar to pipe_sampler_view_reference() but always set the pointer to + * NULL and pass in an explicit context. Passing an explicit context is a + * work-around for fixing a dangling context pointer problem when textures + * are shared by multiple contexts. XXX fix this someday. + */ +static INLINE void +pipe_sampler_view_release(struct pipe_context *ctx, + struct pipe_sampler_view **ptr) +{ + struct pipe_sampler_view *old_view = *ptr; + if (*ptr && (*ptr)->context != ctx) { + debug_printf_once(("context mis-match in pipe_sampler_view_release()\n")); + } + if (pipe_reference_described(&(*ptr)->reference, NULL, + (debug_reference_descriptor)debug_describe_sampler_view)) { + ctx->sampler_view_destroy(ctx, old_view); + } + *ptr = NULL; +} + + static INLINE void pipe_so_target_reference(struct pipe_stream_output_target **ptr, struct pipe_stream_output_target *target) |