mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-23 19:10:21 +01:00
gallium: added pipe_sampler_view_release() function
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
This commit is contained in:
parent
c68334ffc0
commit
4fdf42883f
1 changed files with 22 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue