[Mesa-dev] [PATCH] draw: don't needlessly iterate through all sampler view slots

Jose Fonseca jfonseca at vmware.com
Tue Feb 27 11:41:39 UTC 2018


On 27/02/18 02:35, sroland at vmware.com wrote:
> From: Roland Scheidegger <sroland at vmware.com>
> 
> We already stored the highest (potentially) used number.
> ---
>   src/gallium/auxiliary/draw/draw_context.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/gallium/auxiliary/draw/draw_context.c b/src/gallium/auxiliary/draw/draw_context.c
> index 9791ec5..e887272 100644
> --- a/src/gallium/auxiliary/draw/draw_context.c
> +++ b/src/gallium/auxiliary/draw/draw_context.c
> @@ -973,7 +973,7 @@ draw_set_sampler_views(struct draw_context *draw,
>   
>      for (i = 0; i < num; ++i)
>         draw->sampler_views[shader_stage][i] = views[i];
> -   for (i = num; i < PIPE_MAX_SHADER_SAMPLER_VIEWS; ++i)
> +   for (i = num; i < draw->num_sampler_views[shader_stage]; ++i)
>         draw->sampler_views[shader_stage][i] = NULL;
>   
>      draw->num_sampler_views[shader_stage] = num;
> 

Reviewed-by: Jose Fonseca <jfonseca at vmware.com>


More information about the mesa-dev mailing list