iris: properly pin stencil buffers
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 19 Nov 2018 08:23:54 +0000 (00:23 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 21 Feb 2019 18:26:10 +0000 (10:26 -0800)
src/gallium/drivers/iris/iris_state.c

index 2b632ab3cba3a4d7f1404f2600dae342f76d9e54..caf1f4e445ad4c513d07d64f436a9c451043d566 100644 (file)
@@ -4277,9 +4277,14 @@ iris_upload_dirty_render_state(struct iris_context *ice,
       iris_batch_emit(batch, cso_z->packets, sizeof(cso_z->packets));
 
       if (cso_fb->zsbuf) {
-         struct iris_resource *zres = (void *) cso_fb->zsbuf->texture;
-         // XXX: depth might not be writable...
-         iris_use_pinned_bo(batch, zres->bo, true);
+         struct iris_resource *zres, *sres;
+         iris_get_depth_stencil_resources(cso_fb->zsbuf->texture,
+                                          &zres, &sres);
+         // XXX: might not be writable...
+         if (zres)
+            iris_use_pinned_bo(batch, zres->bo, true);
+         if (sres)
+            iris_use_pinned_bo(batch, sres->bo, true);
       }
    }