anv: Require the local heap for CCS on XeHP

This platform doesn't support CCS in system memory.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14431>
This commit is contained in:
Nanley Chery 2021-12-31 17:21:25 -05:00 committed by Marge Bot
parent 93f8d88fa3
commit 382f6ccda8
1 changed files with 18 additions and 3 deletions

View File

@ -1611,10 +1611,25 @@ anv_image_get_memory_requirements(struct anv_device *device,
* supported memory type for the resource. The bit `1<<i` is set if and
* only if the memory type `i` in the VkPhysicalDeviceMemoryProperties
* structure for the physical device is supported.
*
* All types are currently supported for images.
*/
uint32_t memory_types = (1ull << device->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) {