From 34078b67ed2fc03bff2c7069d7ec00d72d96461a Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Wed, 14 Feb 2024 09:39:12 +0200 Subject: [PATCH] anv: don't allocate aux padded BOs with host pointers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We can't allocate additional space with host pointers anyway. These are already allocated pieces of memory by the application. Signed-off-by: Lionel Landwerlin Fixes: 646a7c864d ("anv: re-introduce BO CCS allocations") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10608 Reviewed-by: Tapani Pälli Part-of: --- src/intel/vulkan/anv_device.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index 33042abcbc2..1710d6a86dd 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -4104,7 +4104,8 @@ VkResult anv_AllocateMemory( if (device->info->has_aux_map) alloc_flags |= ANV_BO_ALLOC_AUX_TT_ALIGNED; - /* If the allocation is not dedicated, allocate additional CCS space. + /* If the allocation is not dedicated nor a host pointer, allocate + * additional CCS space. * * TODO: If we ever ship VK_EXT_descriptor_buffer (ahahah... :() we could * drop this flag in the descriptor buffer case as we don't need any @@ -4113,7 +4114,9 @@ VkResult anv_AllocateMemory( * TODO: We could also create new memory types for allocations that don't * need any compression. */ - if (device->physical->alloc_aux_tt_mem && dedicated_info == NULL) + if (device->physical->alloc_aux_tt_mem && + dedicated_info == NULL && + mem->vk.host_ptr == NULL) alloc_flags |= ANV_BO_ALLOC_AUX_CCS; /* TODO: Android, ChromeOS and other applications may need another way to