Mesa (main): zink: fix sparse binding for arrayed textures

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu May 12 03:50:33 UTC 2022


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

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Wed May 11 16:03:16 2022 -0400

zink: fix sparse binding for arrayed textures

this needs to set the arrayLayer, not the z offset

big thanks to Piers Daniell for catching this

cc: mesa-stable

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

---

 src/gallium/drivers/zink/zink_bo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/zink/zink_bo.c b/src/gallium/drivers/zink/zink_bo.c
index b5f6fda5d67..a80b02390a0 100644
--- a/src/gallium/drivers/zink/zink_bo.c
+++ b/src/gallium/drivers/zink/zink_bo.c
@@ -933,7 +933,7 @@ zink_bo_commit(struct zink_screen *screen, struct zink_resource *res, unsigned l
             // Offset
             ibind[i].offset.x = w * gwidth;
             ibind[i].offset.y = h * gheight;
-            if (res->base.b.target == PIPE_TEXTURE_CUBE) {
+            if (res->base.b.array_size > 1) {
                ibind[i].subresource.arrayLayer = d * gdepth;
                ibind[i].offset.z = 0;
             } else {



More information about the mesa-commit mailing list