From: Bas Nieuwenhuizen Date: Fri, 20 Apr 2018 16:16:02 +0000 (+0200) Subject: radv: Mark GTT memory as device local for APUs. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e1df849c3cfe0c9da7d2f62fc78be94632949903;p=mesa.git radv: Mark GTT memory as device local for APUs. Otherwise a lot of games complain about not having enough memory, and it is sort of local so this seems reasonable to me. CC: 18.0 Reviewed-by: Samuel Pitoiset --- diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index edf099e4f0f..d88d5f06422 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -144,7 +144,7 @@ radv_physical_device_init_mem_types(struct radv_physical_device *device) gart_index = device->memory_properties.memoryHeapCount++; device->memory_properties.memoryHeaps[gart_index] = (VkMemoryHeap) { .size = device->rad_info.gart_size, - .flags = 0, + .flags = device->rad_info.has_dedicated_vram ? 0 : VK_MEMORY_HEAP_DEVICE_LOCAL_BIT, }; } @@ -161,7 +161,8 @@ radv_physical_device_init_mem_types(struct radv_physical_device *device) device->mem_type_indices[type_count] = RADV_MEM_TYPE_GTT_WRITE_COMBINE; device->memory_properties.memoryTypes[type_count++] = (VkMemoryType) { .propertyFlags = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | - VK_MEMORY_PROPERTY_HOST_COHERENT_BIT, + VK_MEMORY_PROPERTY_HOST_COHERENT_BIT | + (device->rad_info.has_dedicated_vram ? 0 : VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT), .heapIndex = gart_index, }; } @@ -179,7 +180,8 @@ radv_physical_device_init_mem_types(struct radv_physical_device *device) device->memory_properties.memoryTypes[type_count++] = (VkMemoryType) { .propertyFlags = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT | - VK_MEMORY_PROPERTY_HOST_CACHED_BIT, + VK_MEMORY_PROPERTY_HOST_CACHED_BIT | + (device->rad_info.has_dedicated_vram ? 0 : VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT), .heapIndex = gart_index, }; }