diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index 1ffd8d7e26f..29009d7af3f 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -2934,6 +2934,8 @@ zink_prep_fb_attachment(struct zink_context *ctx, struct zink_surface *surf, uns layout = VK_IMAGE_LAYOUT_GENERAL; if (res->valid || res->layout != layout) zink_screen(ctx->base.screen)->image_barrier(ctx, res, layout, access, pipeline); + if (!(res->aspect & VK_IMAGE_ASPECT_COLOR_BIT)) + ctx->zsbuf_readonly = res->layout == VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL; res->obj->unordered_read = res->obj->unordered_write = false; if (i == ctx->fb_state.nr_cbufs && res->sampler_bind_count[0]) update_res_sampler_layouts(ctx, res); diff --git a/src/gallium/drivers/zink/zink_types.h b/src/gallium/drivers/zink/zink_types.h index decfbf769eb..a477fd85ecc 100644 --- a/src/gallium/drivers/zink/zink_types.h +++ b/src/gallium/drivers/zink/zink_types.h @@ -1704,6 +1704,7 @@ struct zink_context { bool rp_changed; //force renderpass restart bool rp_layout_changed; //renderpass changed, maybe restart bool rp_loadop_changed; //renderpass changed, don't restart + bool zsbuf_readonly; struct zink_framebuffer *framebuffer; struct zink_framebuffer_clear fb_clears[PIPE_MAX_COLOR_BUFS + 1];