Mesa (staging/20.2): zink: fix layered resolves

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Dec 1 19:52:30 UTC 2020


Module: Mesa
Branch: staging/20.2
Commit: 1b6579613a922e9330a3d46ce84d878891cdcd0f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1b6579613a922e9330a3d46ce84d878891cdcd0f

Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date:   Mon Nov 23 18:41:29 2020 +0100

zink: fix layered resolves

Until recently, we ended up using u_blitter here, because
info->render_condition_enable was always true here. But when we recently
fixed that overly broad check, this broke.

So let's fix layered-resolves, by actually checking if the resource has
layers respect them in that case, similar to what we do in blit_native.

Fixes: 19906022e22 ("zink: more accurately track supported blits")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3843
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7737>
(cherry picked from commit 2ac396e2e5b966a247b698dcc44456fff1ffa0df)

---

 .pick_status.json                    |  2 +-
 src/gallium/drivers/zink/zink_blit.c | 28 ++++++++++++++++++++++------
 2 files changed, 23 insertions(+), 7 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 45c39884df4..9ee76ac5f75 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -3199,7 +3199,7 @@
         "description": "zink: fix layered resolves",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": "19906022e22cb37493861b6976c9623618b5b769"
     },
diff --git a/src/gallium/drivers/zink/zink_blit.c b/src/gallium/drivers/zink/zink_blit.c
index 96824c8a049..81113728b41 100644
--- a/src/gallium/drivers/zink/zink_blit.c
+++ b/src/gallium/drivers/zink/zink_blit.c
@@ -43,19 +43,35 @@ blit_resolve(struct zink_context *ctx, const struct pipe_blit_info *info)
 
    region.srcSubresource.aspectMask = src->aspect;
    region.srcSubresource.mipLevel = info->src.level;
-   region.srcSubresource.baseArrayLayer = 0; // no clue
-   region.srcSubresource.layerCount = 1; // no clue
    region.srcOffset.x = info->src.box.x;
    region.srcOffset.y = info->src.box.y;
-   region.srcOffset.z = info->src.box.z;
+
+   if (src->base.array_size > 1) {
+      region.srcOffset.z = 0;
+      region.srcSubresource.baseArrayLayer = info->src.box.z;
+      region.srcSubresource.layerCount = info->src.box.depth;
+   } else {
+      assert(info->src.box.depth == 1);
+      region.srcOffset.z = info->src.box.z;
+      region.srcSubresource.baseArrayLayer = 0;
+      region.srcSubresource.layerCount = 1;
+   }
 
    region.dstSubresource.aspectMask = dst->aspect;
    region.dstSubresource.mipLevel = info->dst.level;
-   region.dstSubresource.baseArrayLayer = 0; // no clue
-   region.dstSubresource.layerCount = 1; // no clue
    region.dstOffset.x = info->dst.box.x;
    region.dstOffset.y = info->dst.box.y;
-   region.dstOffset.z = info->dst.box.z;
+
+   if (dst->base.array_size > 1) {
+      region.dstOffset.z = 0;
+      region.dstSubresource.baseArrayLayer = info->dst.box.z;
+      region.dstSubresource.layerCount = info->dst.box.depth;
+   } else {
+      assert(info->dst.box.depth == 1);
+      region.dstOffset.z = info->dst.box.z;
+      region.dstSubresource.baseArrayLayer = 0;
+      region.dstSubresource.layerCount = 1;
+   }
 
    region.extent.width = info->dst.box.width;
    region.extent.height = info->dst.box.height;



More information about the mesa-commit mailing list