Mesa (main): zink: warn about missing image2DViewOf3D feature

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jul 25 14:12:42 UTC 2022


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

Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date:   Fri Jul 22 12:20:22 2022 +0200

zink: warn about missing image2DViewOf3D feature

While we're at it, let's store zink_screen in a temp varaible for reuse.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17709>

---

 src/gallium/drivers/zink/zink_context.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c
index e636434178a..9df1e266e67 100644
--- a/src/gallium/drivers/zink/zink_context.c
+++ b/src/gallium/drivers/zink/zink_context.c
@@ -1545,6 +1545,7 @@ finalize_image_bind(struct zink_context *ctx, struct zink_resource *res, bool is
 static struct zink_surface *
 create_image_surface(struct zink_context *ctx, const struct pipe_image_view *view, bool is_compute)
 {
+   struct zink_screen *screen = zink_screen(ctx->base.screen);
    struct zink_resource *res = zink_resource(view->resource);
    struct pipe_surface tmpl = {0};
    enum pipe_texture_target target = res->base.b.target;
@@ -1558,6 +1559,11 @@ create_image_surface(struct zink_context *ctx, const struct pipe_image_view *vie
       if (depth < u_minify(res->base.b.depth0, view->u.tex.level)) {
          assert(depth == 1);
          target = PIPE_TEXTURE_2D;
+         if (!screen->info.have_EXT_image_2d_view_of_3d ||
+             !screen->info.view2d_feats.image2DViewOf3D) {
+            static bool warned = false;
+            warn_missing_feature(warned, "image2DViewOf3D");
+         }
       } else {
          assert(tmpl.u.tex.first_layer == 0);
          tmpl.u.tex.last_layer = 0;
@@ -1570,7 +1576,7 @@ create_image_surface(struct zink_context *ctx, const struct pipe_image_view *vie
       break;
    default: break;
    }
-   VkImageViewCreateInfo ivci = create_ivci(zink_screen(ctx->base.screen), res, &tmpl, target);
+   VkImageViewCreateInfo ivci = create_ivci(screen, res, &tmpl, target);
    struct pipe_surface *psurf = zink_get_surface(ctx, view->resource, &tmpl, &ivci);
    if (!psurf)
       return NULL;



More information about the mesa-commit mailing list