From 382f6ccda8869f72134dbfa9c3cc68a229e01138 Mon Sep 17 00:00:00 2001 From: Nanley Chery Date: Fri, 31 Dec 2021 17:21:25 -0500 Subject: [PATCH] anv: Require the local heap for CCS on XeHP This platform doesn't support CCS in system memory. Reviewed-by: Lionel Landwerlin Part-of: --- src/intel/vulkan/anv_image.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c index d7efd86fc71..c368d503a13 100644 --- a/src/intel/vulkan/anv_image.c +++ b/src/intel/vulkan/anv_image.c @@ -1611,10 +1611,25 @@ anv_image_get_memory_requirements(struct anv_device *device, * supported memory type for the resource. The bit `1<physical->memory.type_count) - 1; + uint32_t memory_types = 0; + for (int i = 0; i < device->physical->memory.type_count; i++) { + const uint32_t heap_index = device->physical->memory.types[i].heapIndex; + + bool memory_type_supported = true; + u_foreach_bit(b, aspects) { + VkImageAspectFlagBits aspect = 1 << b; + const uint32_t plane = anv_image_aspect_to_plane(image, aspect); + + if (device->info.verx10 >= 125 && + isl_aux_usage_has_ccs(image->planes[plane].aux_usage) && + !device->physical->memory.heaps[heap_index].is_local_mem) + memory_type_supported = false; + } + + if (memory_type_supported) + memory_types |= 1 << i; + } vk_foreach_struct(ext, pMemoryRequirements->pNext) { switch (ext->sType) {