Mesa (staging/22.0): zink: reject resource creation if format features don't match attachment

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 21 20:48:24 UTC 2022


Module: Mesa
Branch: staging/22.0
Commit: d85e9e2f2ab8095765151fc6e1615b85f6d6cb7f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d85e9e2f2ab8095765151fc6e1615b85f6d6cb7f

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Wed Apr 13 14:19:58 2022 -0400

zink: reject resource creation if format features don't match attachment

if a rendertarget-specified image can't be a rendertarget or a blit dst
then it can't be used for the designated functionality and must be rejected

cc: mesa-stable

fixes hangs on various nv driver versions:
dEQP-GLES2.functional.texture.mipmap.2d.generate.rgba5551_fastest

Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15960>
(cherry picked from commit 37ac8647fca4ab8aa1be6879fa810def7404449c)

---

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

diff --git a/.pick_status.json b/.pick_status.json
index 80345b1889e..f8f4a31ba03 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1388,7 +1388,7 @@
         "description": "zink: reject resource creation if format features don't match attachment",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "because_sha": null
     },
     {
diff --git a/src/gallium/drivers/zink/zink_resource.c b/src/gallium/drivers/zink/zink_resource.c
index cd59c62258c..a44089a7281 100644
--- a/src/gallium/drivers/zink/zink_resource.c
+++ b/src/gallium/drivers/zink/zink_resource.c
@@ -254,7 +254,7 @@ get_image_usage_for_feats(struct zink_screen *screen, VkFormatFeatureFlags feats
          usage |= VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
          if ((bind & (PIPE_BIND_LINEAR | PIPE_BIND_SHARED)) != (PIPE_BIND_LINEAR | PIPE_BIND_SHARED))
             usage |= VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT;
-      } else if (templ->nr_samples)
+      } else if (templ->nr_samples || !(feats & VK_FORMAT_FEATURE_BLIT_DST_BIT))
          /* this can't be populated, so we can't do it */
          return 0;
    }



More information about the mesa-commit mailing list