[Mesa-dev] [PATCH 1/2] cso: don't cycle through PIPE_MAX_SHADER_SAMPLER_VIEWS on context destroy

Brian Paul brianp at vmware.com
Wed Feb 28 15:25:37 UTC 2018


On 02/27/2018 09:08 PM, sroland at vmware.com wrote:
> From: Roland Scheidegger <sroland at vmware.com>
> 
> There's no point, we know the highest non-null one.
> ---
>   src/gallium/auxiliary/cso_cache/cso_context.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c b/src/gallium/auxiliary/cso_cache/cso_context.c
> index 1b5d4b5..3fa57f1 100644
> --- a/src/gallium/auxiliary/cso_cache/cso_context.c
> +++ b/src/gallium/auxiliary/cso_cache/cso_context.c
> @@ -407,8 +407,10 @@ void cso_destroy_context( struct cso_context *ctx )
>            ctx->pipe->set_stream_output_targets(ctx->pipe, 0, NULL, NULL);
>      }
>   
> -   for (i = 0; i < PIPE_MAX_SHADER_SAMPLER_VIEWS; i++) {
> +   for (i = 0; i < ctx->nr_fragment_views; i++) {
>         pipe_sampler_view_reference(&ctx->fragment_views[i], NULL);
> +   }
> +   for (i = 0; i < ctx->nr_fragment_views_saved; i++) {
>         pipe_sampler_view_reference(&ctx->fragment_views_saved[i], NULL);
>      }
>   
> 

For both,
Reviewed-by: Brian Paul <brianp at vmware.com>


More information about the mesa-dev mailing list