zink: track whether the fb zsbuf is readonly

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21988>
This commit is contained in:
Mike Blumenkrantz
2023-03-17 12:49:04 -04:00
committed by Marge Bot
parent 1b9e9a54ab
commit e2e079eef4
2 changed files with 3 additions and 0 deletions

View File

@@ -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);

View File

@@ -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];