Mesa (main): zink only use zs-specific layout for zs attachments

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Apr 11 00:14:30 UTC 2022


Module: Mesa
Branch: main
Commit: ec05155c30f55062aef07a2042007f95d481ebcc
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ec05155c30f55062aef07a2042007f95d481ebcc

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Fri Apr  8 15:49:08 2022 -0400

zink only use zs-specific layout for zs attachments

otherwise this is illegal

Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15833>

---

 src/gallium/drivers/zink/zink_descriptors.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/zink/zink_descriptors.c b/src/gallium/drivers/zink/zink_descriptors.c
index cd555ae6099..2292e096d6e 100644
--- a/src/gallium/drivers/zink/zink_descriptors.c
+++ b/src/gallium/drivers/zink/zink_descriptors.c
@@ -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;
 }



More information about the mesa-commit mailing list