radv: Don't use dedicated memory info to indicate sharing.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Sun, 21 Feb 2021 20:01:04 +0000 (21:01 +0100)
committerMarge Bot <eric+marge@anholt.net>
Mon, 22 Feb 2021 13:08:40 +0000 (13:08 +0000)
Can be used without sharing, so if only the dedicated memory info
is set we know it isn't shareable. Use that.

Fixes: a639d40f133 ("radv: add support for local bos. (v3)")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4330
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9176>

src/amd/vulkan/radv_device.c

index ffd2696..d58bcec 100644 (file)
@@ -5419,7 +5419,7 @@ static VkResult radv_alloc_memory(struct radv_device *device,
                domain = device->physical_device->memory_domains[pAllocateInfo->memoryTypeIndex];
                flags |= device->physical_device->memory_flags[pAllocateInfo->memoryTypeIndex];
 
-               if (!dedicate_info && !import_info && (!export_info || !export_info->handleTypes)) {
+               if (!import_info && (!export_info || !export_info->handleTypes)) {
                        flags |= RADEON_FLAG_NO_INTERPROCESS_SHARING;
                        if (device->use_global_bo_list) {
                                flags |= RADEON_FLAG_PREFER_LOCAL_BO;