nvk: Bind 3D images as 3D for clears

Normally, Vulkan doesn't support binding 3D image views for rendering
but we support it in NVK.  If we bind it as a 2D array, that requires
setting 2D_ARRAY_COMPATIBLE_BIT to get a 2D array layout.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
This commit is contained in:
Faith Ekstrand 2023-01-30 20:12:01 -06:00 committed by Marge Bot
parent c3f5211137
commit 681224260f

View file

@ -175,9 +175,10 @@ render_view_type(VkImageType image_type, unsigned layer_count)
return layer_count == 1 ? VK_IMAGE_VIEW_TYPE_1D :
VK_IMAGE_VIEW_TYPE_1D_ARRAY;
case VK_IMAGE_TYPE_2D:
case VK_IMAGE_TYPE_3D:
return layer_count == 1 ? VK_IMAGE_VIEW_TYPE_2D :
VK_IMAGE_VIEW_TYPE_2D_ARRAY;
case VK_IMAGE_TYPE_3D:
return VK_IMAGE_VIEW_TYPE_3D;
default:
unreachable("Invalid image type");
}