From c303d399ffd4a03b7a876f4a6b48128846edb76d Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Thu, 15 Feb 2024 12:31:52 +0100 Subject: [PATCH] radv: initialize disk cache slightly later when creating a physical device This will allow us to use a per physical device cache key. Signed-off-by: Samuel Pitoiset Part-of: --- src/amd/vulkan/radv_physical_device.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/amd/vulkan/radv_physical_device.c b/src/amd/vulkan/radv_physical_device.c index b39badffc1c..f57f8d4d989 100644 --- a/src/amd/vulkan/radv_physical_device.c +++ b/src/amd/vulkan/radv_physical_device.c @@ -1956,18 +1956,6 @@ radv_physical_device_try_create(struct radv_instance *instance, drmDevicePtr drm snprintf(device->marketing_name, sizeof(device->name), "%s (RADV %s%s)", marketing_name ? marketing_name : "AMD Unknown", device->rad_info.name, radv_get_compiler_string(device)); - if (radv_device_get_cache_uuid(device, device->cache_uuid)) { - result = vk_errorf(instance, VK_ERROR_INITIALIZATION_FAILED, "cannot generate UUID"); - goto fail_wsi; - } - - /* The gpu id is already embedded in the uuid so we just pass "radv" - * when creating the cache. - */ - char buf[VK_UUID_SIZE * 2 + 1]; - mesa_bytes_to_hex(buf, device->cache_uuid, VK_UUID_SIZE); - device->vk.disk_cache = disk_cache_create(device->name, buf, 0); - if (!radv_is_conformant(device)) vk_warn_non_conformant_implementation("radv"); @@ -2060,6 +2048,18 @@ radv_physical_device_try_create(struct radv_instance *instance, drmDevicePtr drm } #endif + if (radv_device_get_cache_uuid(device, device->cache_uuid)) { + result = vk_errorf(instance, VK_ERROR_INITIALIZATION_FAILED, "cannot generate UUID"); + goto fail_wsi; + } + + /* The gpu id is already embedded in the uuid so we just pass "radv" + * when creating the cache. + */ + char buf[VK_UUID_SIZE * 2 + 1]; + mesa_bytes_to_hex(buf, device->cache_uuid, VK_UUID_SIZE); + device->vk.disk_cache = disk_cache_create(device->name, buf, 0); + radv_get_physical_device_properties(device); if ((device->instance->debug_flags & RADV_DEBUG_INFO))