[Mesa-dev] [PATCH 2/2] softpipe: don't iterate through PIPE_MAX_SHADER_SAMPLER_VIEWS

Jose Fonseca jfonseca at vmware.com
Wed Feb 28 10:35:14 UTC 2018


On 28/02/18 04:08, sroland at vmware.com wrote:
> From: Roland Scheidegger <sroland at vmware.com>
> 
> We were setting view to NULL if the iteration was larger than i.
> But in fact if the view is NULL the code did nothing anyway...
> ---
>   src/gallium/drivers/softpipe/sp_state_sampler.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/gallium/drivers/softpipe/sp_state_sampler.c b/src/gallium/drivers/softpipe/sp_state_sampler.c
> index c10fd91..751eb76 100644
> --- a/src/gallium/drivers/softpipe/sp_state_sampler.c
> +++ b/src/gallium/drivers/softpipe/sp_state_sampler.c
> @@ -181,8 +181,8 @@ prepare_shader_sampling(
>      if (!num)
>         return;
>   
> -   for (i = 0; i < PIPE_MAX_SHADER_SAMPLER_VIEWS; i++) {
> -      struct pipe_sampler_view *view = i < num ? views[i] : NULL;
> +   for (i = 0; i < num; i++) {
> +      struct pipe_sampler_view *view = views[i];
>   
>         if (view) {
>            struct pipe_resource *tex = view->texture;
> 

Series LGTM.

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


More information about the mesa-dev mailing list