From f7597e7d4f4975167ab351a97af63ced1fa66628 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 18 Mar 2021 10:17:25 -0400 Subject: [PATCH] zink: flatten 2d_array surfaces when necessary same as cube types, if this is a single layer then it's not an array Reviewed-by: Dave Airlie Part-of: --- src/gallium/drivers/zink/zink_surface.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gallium/drivers/zink/zink_surface.c b/src/gallium/drivers/zink/zink_surface.c index 02dd851..06b9d0d 100644 --- a/src/gallium/drivers/zink/zink_surface.c +++ b/src/gallium/drivers/zink/zink_surface.c @@ -96,6 +96,9 @@ create_ivci(struct zink_screen *screen, ivci.viewType = VK_IMAGE_VIEW_TYPE_CUBE; else if (templ->u.tex.first_layer || ivci.subresourceRange.layerCount != res->base.array_size) ivci.viewType = VK_IMAGE_VIEW_TYPE_2D_ARRAY; + } else if (ivci.viewType == VK_IMAGE_VIEW_TYPE_2D_ARRAY) { + if (templ->u.tex.first_layer == templ->u.tex.last_layer) + ivci.viewType = VK_IMAGE_VIEW_TYPE_2D; } return ivci; -- 2.7.4