zink: disallow depth-stencil blits with format-change
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Fri, 1 Nov 2019 12:35:55 +0000 (13:35 +0100)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Mon, 3 Feb 2020 20:42:52 +0000 (21:42 +0100)
The Vulkan spec says this about vkCmdBlitImage:

   "No format conversion is supported between depth/stencil images. The
    formats must match."

So yeah, let's stop trying to do this.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3681>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3681>

src/gallium/drivers/zink/zink_blit.c

index fc16aab76290735488dbdf81b5b3b9f359fc61a5..2fa0c359cc05cd350090f3f24bb5c44becaf99ea 100644 (file)
@@ -73,6 +73,10 @@ blit_native(struct zink_context *ctx, const struct pipe_blit_info *info)
        info->alpha_blend)
       return false;
 
+   if (util_format_is_depth_or_stencil(info->dst.format) &&
+       info->dst.format != info->src.format)
+      return false;
+
    struct zink_resource *src = zink_resource(info->src.resource);
    struct zink_resource *dst = zink_resource(info->dst.resource);