iris: properly re-pin stencil buffers
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 20 Sep 2018 22:35:14 +0000 (15:35 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 21 Feb 2019 18:26:08 +0000 (10:26 -0800)
src/gallium/drivers/iris/iris_state.c

index bdded0a1efd716c6dde46bc36bc2a04ffd6bf1af..205f0efcf6004d29f67c9e59e165f05e2c8c0ddf 100644 (file)
@@ -3333,9 +3333,14 @@ iris_restore_context_saved_bos(struct iris_context *ice,
       struct pipe_framebuffer_state *cso_fb = &ice->state.framebuffer;
 
       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);
       }
    }