diff --git a/.pick_status.json b/.pick_status.json index 5866486f218..1782004f60d 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -44,7 +44,7 @@ "description": "nvk: Block off non-2D DRM format modifier images", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "cd428e01d7876da243933ee49f10f866777820f5", "notes": null diff --git a/src/nouveau/vulkan/nvk_image.c b/src/nouveau/vulkan/nvk_image.c index 15cdcc2d14b..ce97627f8f2 100644 --- a/src/nouveau/vulkan/nvk_image.c +++ b/src/nouveau/vulkan/nvk_image.c @@ -389,6 +389,10 @@ nvk_GetPhysicalDeviceImageFormatProperties2( VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT))) return VK_ERROR_FORMAT_NOT_SUPPORTED; + if (pImageFormatInfo->tiling == VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT && + pImageFormatInfo->type != VK_IMAGE_TYPE_2D) + return VK_ERROR_FORMAT_NOT_SUPPORTED; + const uint32_t max_dim = nvk_image_max_dimension(&pdev->info, VK_IMAGE_TYPE_1D); VkExtent3D maxExtent; @@ -417,6 +421,11 @@ nvk_GetPhysicalDeviceImageFormatProperties2( if (ycbcr_info != NULL || pImageFormatInfo->tiling == VK_IMAGE_TILING_LINEAR) maxMipLevels = 1; + if (pImageFormatInfo->tiling == VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT) { + maxArraySize = 1; + maxMipLevels = 1; + } + VkSampleCountFlags sampleCounts = VK_SAMPLE_COUNT_1_BIT; if (pImageFormatInfo->tiling == VK_IMAGE_TILING_OPTIMAL && pImageFormatInfo->type == VK_IMAGE_TYPE_2D &&