From: Kenneth Graunke Date: Thu, 20 Sep 2018 22:35:14 +0000 (-0700) Subject: iris: properly re-pin stencil buffers X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f2f506fa4337d6abfe87799de95a35b935006686;p=mesa.git iris: properly re-pin stencil buffers --- diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c index bdded0a1efd..205f0efcf60 100644 --- a/src/gallium/drivers/iris/iris_state.c +++ b/src/gallium/drivers/iris/iris_state.c @@ -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); } }