From 045a85085afeed0afae1969a6fc52610f060bab5 Mon Sep 17 00:00:00 2001 From: Bas Nieuwenhuizen Date: Thu, 11 Feb 2021 20:32:00 +0100 Subject: [PATCH] radv: Ignore WC flags for VRAM. Otherwise there might be buffers for which we don't have a type. Fixes: 7262c743dc8 ("radv: Determine memory type for import based on fd.") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4280 Reviewed-by: Samuel Pitoiset Part-of: --- src/amd/vulkan/radv_device.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index 6a11f8a2141..61718448aa9 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -7765,6 +7765,11 @@ static uint32_t radv_compute_valid_memory_types(struct radv_physical_device *dev enum radeon_bo_flag ignore_flags = ~(RADEON_FLAG_NO_CPU_ACCESS | RADEON_FLAG_GTT_WC); uint32_t bits = radv_compute_valid_memory_types_attempt(dev, domains, flags, ignore_flags); + if (!bits) { + ignore_flags |= RADEON_FLAG_GTT_WC; + bits = radv_compute_valid_memory_types_attempt(dev, domains, flags, ignore_flags); + } + if (!bits) { ignore_flags |= RADEON_FLAG_NO_CPU_ACCESS; bits = radv_compute_valid_memory_types_attempt(dev, domains, flags, ignore_flags);