iris: fix set_sampler_view
authorRob Clark <robdclark@gmail.com>
Thu, 14 Mar 2019 19:12:28 +0000 (15:12 -0400)
committerRob Clark <robdclark@gmail.com>
Sat, 30 Mar 2019 17:05:31 +0000 (13:05 -0400)
Update to match docs.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/gallium/drivers/iris/iris_state.c

index 8f93b7336438e8aff71247a80d3bafdb9e29061c..25c2af9845e9f9af69dd97c5a7b0fb5c74375048 100644 (file)
@@ -2032,9 +2032,10 @@ iris_set_sampler_views(struct pipe_context *ctx,
    shs->bound_sampler_views &= ~u_bit_consecutive(start, count);
 
    for (unsigned i = 0; i < count; i++) {
+      struct pipe_sampler_view *pview = views ? views[i] : NULL;
       pipe_sampler_view_reference((struct pipe_sampler_view **)
-                                  &shs->textures[start + i], views[i]);
-      struct iris_sampler_view *view = (void *) views[i];
+                                  &shs->textures[start + i], pview);
+      struct iris_sampler_view *view = (void *) pview;
       if (view) {
          view->res->bind_history |= PIPE_BIND_SAMPLER_VIEW;
          shs->bound_sampler_views |= 1 << (start + i);