Mesa (main): zink: clamp 3D surface viewtype to 2D only in the create_surface hook
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon May 10 01:01:17 UTC 2021
Module: Mesa
Branch: main
Commit: 438f0b31e2780c1b3cf62559ec12efea7f8c25b0
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=438f0b31e2780c1b3cf62559ec12efea7f8c25b0
Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date: Fri Apr 2 14:53:31 2021 -0400
zink: clamp 3D surface viewtype to 2D only in the create_surface hook
this is only applicable to things that go through the hook, not for internal
surfaces
Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10703>
---
src/gallium/drivers/zink/zink_surface.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/gallium/drivers/zink/zink_surface.c b/src/gallium/drivers/zink/zink_surface.c
index 568645f4508..4cae6fd11ec 100644
--- a/src/gallium/drivers/zink/zink_surface.c
+++ b/src/gallium/drivers/zink/zink_surface.c
@@ -67,7 +67,7 @@ create_ivci(struct zink_screen *screen,
break;
case PIPE_TEXTURE_3D:
- ivci.viewType = VK_IMAGE_VIEW_TYPE_2D;
+ ivci.viewType = VK_IMAGE_VIEW_TYPE_3D;
break;
default:
@@ -176,6 +176,8 @@ zink_create_surface(struct pipe_context *pctx,
VkImageViewCreateInfo ivci = create_ivci(zink_screen(pctx->screen),
zink_resource(pres), templ);
+ if (pres->target == PIPE_TEXTURE_3D)
+ ivci.viewType = VK_IMAGE_VIEW_TYPE_2D;
return zink_get_surface(zink_context(pctx), pres, templ, &ivci);
}
More information about the mesa-commit
mailing list