nvk: Require dedicated allocations for external images

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
This commit is contained in:
Faith Ekstrand
2023-07-17 16:54:28 -05:00
committed by Marge Bot
parent 7f0c06e130
commit 10ffe8e709
+7 -2
View File
@@ -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: