From abac4859618e02aea00f705b841a7c5c5007ad1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Gu=C3=A9rin?= Date: Tue, 2 Jun 2020 22:14:44 -0700 Subject: [PATCH] radv: Always expose non-visible local memory type on dedicated GPUs DOOM Eternal expects this type, but RADV doesn't expose it when the VRAM is entirely host-visible, in my case on Fiji. Matches AMDVLK behavior. Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/3054 Cc: Reviewed-by: Bas Nieuwenhuizen Reviewed-by: Samuel Pitoiset Part-of: (cherry picked from commit 202252566bf053a31a4162e99f6fef5b82efc837) --- .pick_status.json | 2 +- src/amd/vulkan/radv_device.c | 25 +++++++------------------ 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index e7b160761f0..68f7d2a59e8 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1399,7 +1399,7 @@ "description": "radv: Always expose non-visible local memory type on dedicated GPUs", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": null }, diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index 3c0c40c387e..522c2cc927e 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -162,24 +162,13 @@ radv_physical_device_init_mem_types(struct radv_physical_device *device) unsigned type_count = 0; - if (device->rad_info.has_dedicated_vram) { - if (vram_index >= 0) { - device->memory_domains[type_count] = RADEON_DOMAIN_VRAM; - device->memory_flags[type_count] = RADEON_FLAG_NO_CPU_ACCESS; - device->memory_properties.memoryTypes[type_count++] = (VkMemoryType) { - .propertyFlags = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT, - .heapIndex = vram_index, - }; - } - } else { - if (visible_vram_index >= 0) { - device->memory_domains[type_count] = RADEON_DOMAIN_VRAM; - device->memory_flags[type_count] = RADEON_FLAG_NO_CPU_ACCESS; - device->memory_properties.memoryTypes[type_count++] = (VkMemoryType) { - .propertyFlags = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT, - .heapIndex = visible_vram_index, - }; - } + if (vram_index >= 0 || visible_vram_index >= 0) { + device->memory_domains[type_count] = RADEON_DOMAIN_VRAM; + device->memory_flags[type_count] = RADEON_FLAG_NO_CPU_ACCESS; + device->memory_properties.memoryTypes[type_count++] = (VkMemoryType) { + .propertyFlags = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT, + .heapIndex = vram_index >= 0 ? vram_index : visible_vram_index, + }; } if (gart_index >= 0) {