}
if (batch->in_rp) {
- if (buffers & PIPE_CLEAR_DEPTHSTENCIL && (!zink_is_zsbuf_used(ctx) || ctx->zsbuf_readonly)) {
+ if (buffers & PIPE_CLEAR_DEPTHSTENCIL && (ctx->zsbuf_unused || ctx->zsbuf_readonly)) {
/* this will need a layout change */
assert(!zink_screen(ctx->base.screen)->driver_workarounds.track_renderpasses);
zink_batch_no_rp(ctx);
ctx->dynamic_fb.tc_info.data = info->data;
} else {
struct tc_renderpass_info info = ctx->dynamic_fb.tc_info;
- bool zsbuf_used = zink_is_zsbuf_used(ctx);
+ bool zsbuf_used = !ctx->zsbuf_unused;
bool zsbuf_write = zink_is_zsbuf_write(ctx);
ctx->dynamic_fb.tc_info.data32[0] = 0;
if (ctx->clears_enabled & PIPE_CLEAR_DEPTHSTENCIL)
ctx->dynamic_fb.attachments[PIPE_MAX_COLOR_BUFS+1].imageLayout = zink_resource(surf->base.texture)->layout;
assert(ctx->dynamic_fb.attachments[PIPE_MAX_COLOR_BUFS+1].imageLayout != VK_IMAGE_LAYOUT_UNDEFINED);
}
+ ctx->zsbuf_unused = !zsbuf_used;
assert(ctx->fb_state.width >= ctx->dynamic_fb.info.renderArea.extent.width);
assert(ctx->fb_state.height >= ctx->dynamic_fb.info.renderArea.extent.height);
ctx->gfx_pipeline_state.dirty |= rp_changed;
infos.pAttachments = att;
if (!prep_fb_attachments(ctx, att))
return 0;
+ ctx->zsbuf_unused = !zink_is_zsbuf_used(ctx);
/* this can be set if fbfetch is activated */
ctx->rp_changed = false;
#ifndef NDEBUG
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_unused;
bool zsbuf_readonly;
struct zink_framebuffer *framebuffer;