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@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10703>
This commit is contained in:
Mike Blumenkrantz 2021-04-02 14:53:31 -04:00 committed by Marge Bot
parent 0c2453bb59
commit 438f0b31e2

View file

@ -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);
}