iris: fix crash in sparse vertex array
authorDave Airlie <airlied@redhat.com>
Wed, 7 Nov 2018 01:49:04 +0000 (11:49 +1000)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 21 Feb 2019 18:26:09 +0000 (10:26 -0800)
this fixes crash in array-stride piglit.

src/gallium/drivers/iris/iris_state.c

index 06e3e8eacc582b4cb4b8076bdebd931cad61c96c..c0173e45d96d48f8e785b0ae43260a605c070895 100644 (file)
@@ -4208,7 +4208,8 @@ iris_upload_dirty_render_state(struct iris_context *ice,
 
          for (unsigned i = 0; i < cso->num_buffers; i++) {
             struct iris_resource *res = (void *) cso->resources[i];
-            iris_use_pinned_bo(batch, res->bo, false);
+            if (res)
+               iris_use_pinned_bo(batch, res->bo, false);
          }
       }
    }