zink: be more careful about the mask-check
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Fri, 1 Nov 2019 12:21:59 +0000 (13:21 +0100)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Mon, 3 Feb 2020 20:42:49 +0000 (21:42 +0100)
We currently disallow blits that we can support. Let's be more accurate
when checking the mask.

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

src/gallium/drivers/zink/zink_blit.c

index bc788556bb8a75c0229c63743ec74800a598d146..fc16aab76290735488dbdf81b5b3b9f359fc61a5 100644 (file)
@@ -9,7 +9,8 @@
 static bool
 blit_resolve(struct zink_context *ctx, const struct pipe_blit_info *info)
 {
-   if (info->mask != PIPE_MASK_RGBA ||
+   if (util_format_get_mask(info->dst.format) != info->mask ||
+       util_format_get_mask(info->src.format) != info->mask ||
        info->scissor_enable ||
        info->alpha_blend)
       return false;
@@ -66,7 +67,8 @@ blit_resolve(struct zink_context *ctx, const struct pipe_blit_info *info)
 static bool
 blit_native(struct zink_context *ctx, const struct pipe_blit_info *info)
 {
-   if (info->mask != PIPE_MASK_RGBA ||
+   if (util_format_get_mask(info->dst.format) != info->mask ||
+       util_format_get_mask(info->src.format) != info->mask ||
        info->scissor_enable ||
        info->alpha_blend)
       return false;