zink: block resolves where src extents > dst extents
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Wed, 29 Mar 2023 20:42:02 +0000 (16:42 -0400)
committerMarge Bot <emma+marge@anholt.net>
Thu, 30 Mar 2023 21:13:40 +0000 (21:13 +0000)
vulkan resolves only provide "extents" instead of src and dst regions like
GL, which means vk resolves can't be used to downscale images, as such
operations will instead just crop the image

fixes #8655

cc: mesa-stable

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

src/gallium/drivers/zink/zink_blit.c

index 84e7803..8f3e75f 100644 (file)
@@ -41,6 +41,11 @@ blit_resolve(struct zink_context *ctx, const struct pipe_blit_info *info, bool *
        info->src.box.depth < 0 ||
        info->dst.box.depth < 0)
       return false;
+   /* vulkan resolves can't downscale */
+   if (info->src.box.width > info->dst.box.width ||
+       info->src.box.height > info->dst.box.height ||
+       info->src.box.depth > info->dst.box.depth)
+      return false;
 
    if (info->render_condition_enable &&
        ctx->render_condition_active)