diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c index e17e54aa088..2b74e94505e 100644 --- a/src/intel/vulkan/anv_image.c +++ b/src/intel/vulkan/anv_image.c @@ -1928,32 +1928,17 @@ anv_image_get_memory_requirements(struct anv_device *device, switch (ext->sType) { case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS: { VkMemoryDedicatedRequirements *requirements = (void *)ext; - if (image->vk.wsi_legacy_scanout || image->from_ahb) { - /* If we need to set the tiling for external consumers, we need a - * dedicated allocation. + if (image->vk.wsi_legacy_scanout || + image->from_ahb || + (isl_drm_modifier_has_aux(image->vk.drm_format_mod) && + anv_image_uses_aux_map(device, image))) { + /* If we need to set the tiling for external consumers or the + * modifier involves AUX tables, we need a dedicated allocation. * * See also anv_AllocateMemory. */ requirements->prefersDedicatedAllocation = true; requirements->requiresDedicatedAllocation = true; - } else if (anv_image_uses_aux_map(device, image)) { - /* We request a dedicated allocation to guarantee that the BO will - * be aux-map compatible (see anv_bo_vma_alloc_or_close and - * anv_bo_allows_aux_map). - * - * TODO: This is an untested heuristic. It's not known if this - * guarantee is worth losing suballocation. - * - * If we don't have an aux-map compatible BO at the time we bind - * this image to device memory, we'll change the aux usage. - * - * It may be possible to handle an image using a modifier in the - * same way. However, we choose to keep things simple and require - * a dedicated allocation for that case. - */ - requirements->prefersDedicatedAllocation = true; - requirements->requiresDedicatedAllocation = - isl_drm_modifier_has_aux(image->vk.drm_format_mod); } else { requirements->prefersDedicatedAllocation = false; requirements->requiresDedicatedAllocation = false;