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

Author: Samuel Pitoiset <samuel.pitoi...@gmail.com>
Date:   Fri Dec  1 09:17:41 2023 +0100

radv: adjust assertions for multi-layer resolves with the HW/FS paths

Only compute supports layers.

Signed-off-by: Samuel Pitoiset <samuel.pitoi...@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26316>

---

 src/amd/vulkan/meta/radv_meta_resolve.c    | 8 +++-----
 src/amd/vulkan/meta/radv_meta_resolve_fs.c | 5 +++--
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/amd/vulkan/meta/radv_meta_resolve.c 
b/src/amd/vulkan/meta/radv_meta_resolve.c
index d2ebc0a7fe3..fa425f48b67 100644
--- a/src/amd/vulkan/meta/radv_meta_resolve.c
+++ b/src/amd/vulkan/meta/radv_meta_resolve.c
@@ -344,14 +344,12 @@ radv_meta_resolve_hardware_image(struct radv_cmd_buffer 
*cmd_buffer, struct radv
     *
     *    - The aspectMask member of srcSubresource and dstSubresource must
     *      only contain VK_IMAGE_ASPECT_COLOR_BIT
-    *
-    *    - The layerCount member of srcSubresource and dstSubresource must
-    *      match
     */
    assert(region->srcSubresource.aspectMask == VK_IMAGE_ASPECT_COLOR_BIT);
    assert(region->dstSubresource.aspectMask == VK_IMAGE_ASPECT_COLOR_BIT);
-   assert(vk_image_subresource_layer_count(&src_image->vk, 
&region->srcSubresource) ==
-          vk_image_subresource_layer_count(&dst_image->vk, 
&region->dstSubresource));
+   /* Multi-layer resolves are handled by compute */
+   assert(vk_image_subresource_layer_count(&src_image->vk, 
&region->srcSubresource) == 1 &&
+          vk_image_subresource_layer_count(&dst_image->vk, 
&region->dstSubresource) == 1);
    /**
     * From Vulkan 1.0.6 spec: 18.6 Resolving Multisample Images
     *
diff --git a/src/amd/vulkan/meta/radv_meta_resolve_fs.c 
b/src/amd/vulkan/meta/radv_meta_resolve_fs.c
index f0e0056feed..ef6cae13a21 100644
--- a/src/amd/vulkan/meta/radv_meta_resolve_fs.c
+++ b/src/amd/vulkan/meta/radv_meta_resolve_fs.c
@@ -726,8 +726,9 @@ radv_meta_resolve_fragment_image(struct radv_cmd_buffer 
*cmd_buffer, struct radv
 
    assert(region->srcSubresource.aspectMask == VK_IMAGE_ASPECT_COLOR_BIT);
    assert(region->dstSubresource.aspectMask == VK_IMAGE_ASPECT_COLOR_BIT);
-   assert(vk_image_subresource_layer_count(&src_image->vk, 
&region->srcSubresource) ==
-          vk_image_subresource_layer_count(&dst_image->vk, 
&region->dstSubresource));
+   /* Multi-layer resolves are handled by compute */
+   assert(vk_image_subresource_layer_count(&src_image->vk, 
&region->srcSubresource) == 1 &&
+          vk_image_subresource_layer_count(&dst_image->vk, 
&region->dstSubresource) == 1);
 
    const struct VkExtent3D extent = vk_image_sanitize_extent(&src_image->vk, 
region->extent);
    const struct VkOffset3D srcOffset = 
vk_image_sanitize_offset(&src_image->vk, region->srcOffset);

Reply via email to