diff --git a/src/nouveau/vulkan/nvk_image.c b/src/nouveau/vulkan/nvk_image.c index 8cfa435ac56..3f1c8f07c4d 100644 --- a/src/nouveau/vulkan/nvk_image.c +++ b/src/nouveau/vulkan/nvk_image.c @@ -512,6 +512,11 @@ nvk_GetImageMemoryRequirements2(VkDevice device, nvk_image_plane_add_req(&image->planes[plane], &size_B, &align_B); } + assert(image->vk.external_handle_types == 0 || image->plane_count == 1); + bool needs_dedicated = + image->vk.external_handle_types != 0 && + image->planes[0].nil.pte_kind != 0; + if (image->stencil_copy_temp.nil.size_B > 0) nvk_image_plane_add_req(&image->stencil_copy_temp, &size_B, &align_B); @@ -523,8 +528,8 @@ nvk_GetImageMemoryRequirements2(VkDevice device, switch (ext->sType) { case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS: { VkMemoryDedicatedRequirements *dedicated = (void *)ext; - dedicated->prefersDedicatedAllocation = false; - dedicated->requiresDedicatedAllocation = false; + dedicated->prefersDedicatedAllocation = needs_dedicated; + dedicated->requiresDedicatedAllocation = needs_dedicated; break; } default: