diff options
author | Mike Blumenkrantz <michael.blumenkrantz@gmail.com> | 2022-02-18 09:42:25 -0500 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2022-02-28 17:42:58 +0000 |
commit | 26d05e5a38e69c37748578ffe583756026fda51b (patch) | |
tree | 774bfd0188e3dfb4f760d2cc780277733f5c7e68 | |
parent | 69ec429c00ee32d5bf51e549876b9ca2daf2cbf6 (diff) |
zink: directly create surfaces for shader images
avoid the implicit clamping of fb surfaces in zink_create_surface()
in order to provide more granularity
no functional changes
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15172>
-rw-r--r-- | src/gallium/drivers/zink/zink_context.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index 07fc69f8c85..c5cfd025215 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -1327,16 +1327,16 @@ create_image_surface(struct zink_context *ctx, const struct pipe_image_view *vie { struct zink_resource *res = zink_resource(view->resource); struct pipe_surface tmpl = {0}; + enum pipe_texture_target target = res->base.b.target == PIPE_TEXTURE_3D ? PIPE_TEXTURE_2D : res->base.b.target; tmpl.format = view->format; tmpl.u.tex.level = view->u.tex.level; tmpl.u.tex.first_layer = view->u.tex.first_layer; tmpl.u.tex.last_layer = view->u.tex.last_layer; - struct pipe_surface *psurf = ctx->base.create_surface(&ctx->base, &res->base.b, &tmpl); + VkImageViewCreateInfo ivci = create_ivci(zink_screen(ctx->base.screen), res, &tmpl, target); + struct pipe_surface *psurf = zink_get_surface(ctx, view->resource, &tmpl, &ivci); if (!psurf) return NULL; - /* this is actually a zink_ctx_surface, but we just want the inner surface */ - struct zink_surface *surface = zink_csurface(psurf); - FREE(psurf); + struct zink_surface *surface = zink_surface(psurf); if (is_compute) flush_pending_clears(ctx, res); return surface; |