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

Author: Mike Blumenkrantz <michael.blumenkra...@gmail.com>
Date:   Tue Jan  9 09:03:52 2024 -0500

zink: use maint6 for multi-layer compressed surface creation

this should speed up multi-layer copying

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26953>

---

 src/gallium/drivers/zink/zink_surface.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/zink/zink_surface.c 
b/src/gallium/drivers/zink/zink_surface.c
index 16a92624bf5..31a57e85c85 100644
--- a/src/gallium/drivers/zink/zink_surface.c
+++ b/src/gallium/drivers/zink/zink_surface.c
@@ -304,8 +304,11 @@ zink_create_surface(struct pipe_context *pctx,
          If image was created with the 
VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT flag and
          format is a non-compressed format, the levelCount and layerCount 
members of
          subresourceRange must both be 1
+
+         ...but this is allowed with a maintenance6 property
        */
-      if (util_format_is_compressed(pres->format) && templ->u.tex.first_layer 
!= templ->u.tex.last_layer)
+      if (util_format_is_compressed(pres->format) && templ->u.tex.first_layer 
!= templ->u.tex.last_layer &&
+          (!screen->info.have_KHR_maintenance6 || 
!screen->info.maint6_props.blockTexelViewCompatibleMultipleLayers))
          return NULL;
    }
 

Reply via email to