nvk: Use 2D array views for 3D storage images

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 1fd3e5ff1d
commit 640783513b
4 changed files with 26 additions and 1 deletions

View File

@@ -230,6 +230,12 @@ nvk_image_init(struct nvk_device *device,
if (pCreateInfo->flags & VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT)
usage |= NIL_IMAGE_USAGE_2D_VIEW_BIT;
/* We treat 3D storage images as 2D arrays. One day, we may wire up actual
* 3D storage image support but baseArrayLayer gets tricky.
*/
if (image->vk.usage & VK_IMAGE_USAGE_STORAGE_BIT)
usage |= NIL_IMAGE_USAGE_2D_VIEW_BIT;
struct nil_image_init_info nil_info = {
.dim = vk_image_type_to_nil_dim(pCreateInfo->imageType),
.format = vk_format_to_pipe_format(pCreateInfo->format),