Mesa (staging/22.0): zink: only reject non-blittable resource creation if it has no other binds

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri May 20 16:27:30 UTC 2022


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

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Wed Apr 20 09:45:51 2022 -0400

zink: only reject non-blittable resource creation if it has no other binds

the idea here is that if a resource is intended to be used solely as a rendertarget
and can't be blitted to or drawn to, then resource creation should fail

but if the resource might be e.g., a texture, then it can probably hit the subdata
path and be fine

Fixes: 37ac8647fca ("zink: reject resource creation if format features don't match attachment")

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

---

 .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 fa284383371..3e432644118 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1052,7 +1052,7 @@
         "description": "zink: only reject non-blittable resource creation if it has no other binds",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "because_sha": "37ac8647fca4ab8aa1be6879fa810def7404449c"
     },
     {
diff --git a/src/gallium/drivers/zink/zink_resource.c b/src/gallium/drivers/zink/zink_resource.c
index cb6b1e0e077..6ca1040560c 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 || !(feats & VK_FORMAT_FEATURE_BLIT_DST_BIT))
+      } else if (templ->nr_samples || (bind == PIPE_BIND_RENDER_TARGET && !(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