anv: improve vma usage for descriptor buffer

The dynamic visible memory type (or the prior descriptor buffer memory
type) doesn't need special aux-tt alignment or additional ccs space.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30317>
This commit is contained in:
Yiwei Zhang
2024-07-22 23:09:08 -07:00
committed by Marge Bot
parent 8a5ef9413b
commit 6d0273f67a

View File

@@ -1414,25 +1414,22 @@ VkResult anv_AllocateMemory(
* alignment reported through vkGetImageMemoryRequirements() meet the * alignment reported through vkGetImageMemoryRequirements() meet the
* AUX-TT requirement. * AUX-TT requirement.
* *
* TODO: when we enable EXT_descriptor_buffer, we'll be able to drop the * Allocations with the special dynamic_visible mem type are for things like
* AUX-TT alignment for that type of allocation. * descriptor buffers, so AUX-TT alignment is not needed here.
*/ */
if (device->info->has_aux_map) if (device->info->has_aux_map && !mem_type->dynamic_visible)
alloc_flags |= ANV_BO_ALLOC_AUX_TT_ALIGNED; alloc_flags |= ANV_BO_ALLOC_AUX_TT_ALIGNED;
/* If the allocation is not dedicated nor a host pointer, allocate /* If the allocation is not dedicated nor a host pointer, allocate
* additional CCS space. * additional CCS space.
* *
* TODO: If we ever ship VK_EXT_descriptor_buffer (ahahah... :() we could * Allocations with the special dynamic_visible mem type are for things like
* drop this flag in the descriptor buffer case as we don't need any * descriptor buffers, which don't need any compression.
* compression there.
*
* TODO: We could also create new memory types for allocations that don't
* need any compression.
*/ */
if (device->physical->alloc_aux_tt_mem && if (device->physical->alloc_aux_tt_mem &&
dedicated_info == NULL && dedicated_info == NULL &&
mem->vk.host_ptr == NULL) mem->vk.host_ptr == NULL &&
!mem_type->dynamic_visible)
alloc_flags |= ANV_BO_ALLOC_AUX_CCS; alloc_flags |= ANV_BO_ALLOC_AUX_CCS;
/* TODO: Android, ChromeOS and other applications may need another way to /* TODO: Android, ChromeOS and other applications may need another way to