From f2f506fa4337d6abfe87799de95a35b935006686 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Thu, 20 Sep 2018 15:35:14 -0700 Subject: [PATCH] iris: properly re-pin stencil buffers --- src/gallium/drivers/iris/iris_state.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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); } } -- 2.30.2