softpipe: don't iterate through PIPE_MAX_SHADER_SAMPLER_VIEWS
authorRoland Scheidegger <sroland@vmware.com>
Wed, 28 Feb 2018 03:28:29 +0000 (04:28 +0100)
committerRoland Scheidegger <sroland@vmware.com>
Wed, 28 Feb 2018 17:22:28 +0000 (18:22 +0100)
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...

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
src/gallium/drivers/softpipe/sp_state_sampler.c

index c10fd918fd8fdeb6fe98e085327e8ffd30581c91..751eb76e84b667821dca096ed6e71beb12c91bd8 100644 (file)
@@ -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;