[Mesa-dev] [PATCH 1/2] st/mesa: release sampler views when redefining a texture in st_context_teximage

Nicolai Hähnle nhaehnle at gmail.com
Fri Jul 28 05:23:38 UTC 2017


On 28.07.2017 02:27, Marek Olšák wrote:
> From: Marek Olšák <marek.olsak at amd.com>
> 
> Noticed randomly.
> 
> Cc: 17.2 <mesa-stable at lists.freedesktop.org>

Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>


> ---
>   src/mesa/state_tracker/st_manager.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c
> index 62924b0..4b4d4ac 100644
> --- a/src/mesa/state_tracker/st_manager.c
> +++ b/src/mesa/state_tracker/st_manager.c
> @@ -41,20 +41,21 @@
>   #include "util/hash_table.h"
>   #include "st_texture.h"
>   
>   #include "st_context.h"
>   #include "st_debug.h"
>   #include "st_extensions.h"
>   #include "st_format.h"
>   #include "st_cb_fbo.h"
>   #include "st_cb_flush.h"
>   #include "st_manager.h"
> +#include "st_sampler_view.h"
>   
>   #include "state_tracker/st_gl_api.h"
>   
>   #include "pipe/p_context.h"
>   #include "pipe/p_screen.h"
>   #include "util/u_format.h"
>   #include "util/u_pointer.h"
>   #include "util/u_inlines.h"
>   #include "util/u_atomic.h"
>   #include "util/u_surface.h"
> @@ -728,20 +729,21 @@ st_context_teximage(struct st_context_iface *stctxi,
>         }
>      }
>      else {
>         _mesa_clear_texture_image(ctx, texImage);
>         width = height = depth = 0;
>      }
>   
>      pipe_resource_reference(&stImage->pt, tex);
>      stObj->surface_format = pipe_format;
>   
> +   st_texture_release_all_sampler_views(st, stObj);
>      stObj->needs_validation = true;
>   
>      _mesa_dirty_texobj(ctx, texObj);
>      _mesa_unlock_texture(ctx, texObj);
>   
>      return TRUE;
>   }
>   
>   static void
>   st_context_copy(struct st_context_iface *stctxi,
> 


-- 
Lerne, wie die Welt wirklich ist,
Aber vergiss niemals, wie sie sein sollte.


More information about the mesa-dev mailing list