zink only use zs-specific layout for zs attachments

otherwise this is illegal

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15833>
This commit is contained in:
Mike Blumenkrantz 2022-04-08 15:49:08 -04:00 committed by Marge Bot
parent 97d5ebc93e
commit ec05155c30
1 changed files with 2 additions and 1 deletions

View File

@ -574,7 +574,8 @@ zink_descriptor_util_image_layout_eval(const struct zink_context *ctx, const str
if (!is_compute && res->fb_binds &&
ctx->gfx_pipeline_state.render_pass && ctx->gfx_pipeline_state.render_pass->state.rts[ctx->fb_state.nr_cbufs].mixed_zs)
return VK_IMAGE_LAYOUT_GENERAL;
return VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL;
if (res->obj->vkusage & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT)
return VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL;
}
return VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;
}