Mesa (master): radv: Always expose non-visible local memory type on dedicated GPUs
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Jun 4 15:49:53 UTC 2020
Module: Mesa
Branch: master
Commit: 202252566bf053a31a4162e99f6fef5b82efc837
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=202252566bf053a31a4162e99f6fef5b82efc837
Author: Clément Guérin <libcg at protonmail.com>
Date: Tue Jun 2 22:14:44 2020 -0700
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: <mesa-stable at lists.freedesktop.org>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5308>
---
src/amd/vulkan/radv_device.c | 25 +++++++------------------
1 file changed, 7 insertions(+), 18 deletions(-)
diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index c6845c5c494..4d3d0dea3e4 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) {
More information about the mesa-commit
mailing list