From 8bfd18b8c51f5e0170b9171cefbcb588a8b93d9e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Sch=C3=BCrmann?= Date: Fri, 12 May 2023 12:19:14 +0200 Subject: [PATCH] vulkan/pipeline_cache: don't log warnings for client-invisible caches Fixes: d3f06cf5ce0764b37a03a0f2bfbb109a4d75884d ('vulkan/pipeline_cache: don't log warnings for internal caches') Part-of: --- src/amd/vulkan/meta/radv_meta.c | 12 ++++-------- src/amd/vulkan/radv_device.c | 4 +--- src/freedreno/vulkan/tu_device.cc | 4 +--- src/intel/vulkan/anv_device.c | 4 +--- src/intel/vulkan_hasvk/anv_device.c | 4 +--- src/vulkan/runtime/vk_pipeline_cache.c | 5 +---- src/vulkan/runtime/vk_pipeline_cache.h | 5 ----- 7 files changed, 9 insertions(+), 29 deletions(-) diff --git a/src/amd/vulkan/meta/radv_meta.c b/src/amd/vulkan/meta/radv_meta.c index 0781996..d79c186 100644 --- a/src/amd/vulkan/meta/radv_meta.c +++ b/src/amd/vulkan/meta/radv_meta.c @@ -339,14 +339,11 @@ radv_load_meta_pipeline(struct radv_device *device) void *data = NULL; bool ret = false; int fd = -1; + VkResult result = VK_SUCCESS; VkPipelineCacheCreateInfo create_info = { .sType = VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO, }; - struct vk_pipeline_cache_create_info info = { - .pCreateInfo = &create_info, - .internal = true, - }; if (!radv_builtin_cache_path(path)) goto fail; @@ -366,10 +363,9 @@ radv_load_meta_pipeline(struct radv_device *device) create_info.pInitialData = data; fail: - device->meta_state.cache = - vk_pipeline_cache_to_handle(vk_pipeline_cache_create(&device->vk, &info, NULL)); - - if (device->meta_state.cache) { + result = vk_common_CreatePipelineCache(radv_device_to_handle(device), &create_info, NULL, + &device->meta_state.cache); + if (result == VK_SUCCESS) { device->meta_state.initial_cache_entries = num_cache_entries(device->meta_state.cache); ret = device->meta_state.initial_cache_entries > 0; } diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index cce1251..f5559ba 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -1048,9 +1048,7 @@ radv_CreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCr if (device->physical_device->rad_info.gfx_level >= GFX7) cik_create_gfx_config(device); - struct vk_pipeline_cache_create_info info = { - .internal = true, - }; + struct vk_pipeline_cache_create_info info = {0}; device->mem_cache = vk_pipeline_cache_create(&device->vk, &info, NULL); if (!device->mem_cache) goto fail_meta; diff --git a/src/freedreno/vulkan/tu_device.cc b/src/freedreno/vulkan/tu_device.cc index 53b6128..1ad80b1 100644 --- a/src/freedreno/vulkan/tu_device.cc +++ b/src/freedreno/vulkan/tu_device.cc @@ -2055,9 +2055,7 @@ tu_CreateDevice(VkPhysicalDevice physicalDevice, struct tu6_global *global = NULL; uint32_t global_size = sizeof(struct tu6_global); - struct vk_pipeline_cache_create_info pcc_info = { - .internal = true, - }; + struct vk_pipeline_cache_create_info pcc_info = { }; for (unsigned i = 0; i < pCreateInfo->queueCreateInfoCount; i++) { const VkDeviceQueueCreateInfo *queue_create = diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index 1c3b9c0..8dc7bea 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -3324,9 +3324,7 @@ VkResult anv_CreateDevice( if (result != VK_SUCCESS) goto fail_btd_fifo_bo; - struct vk_pipeline_cache_create_info pcc_info = { - .internal = true, - }; + struct vk_pipeline_cache_create_info pcc_info = { }; device->default_pipeline_cache = vk_pipeline_cache_create(&device->vk, &pcc_info, NULL); if (!device->default_pipeline_cache) { diff --git a/src/intel/vulkan_hasvk/anv_device.c b/src/intel/vulkan_hasvk/anv_device.c index d947e9f..af4d759 100644 --- a/src/intel/vulkan_hasvk/anv_device.c +++ b/src/intel/vulkan_hasvk/anv_device.c @@ -2956,9 +2956,7 @@ VkResult anv_CreateDevice( if (result != VK_SUCCESS) goto fail_trivial_batch_bo_and_scratch_pool; - struct vk_pipeline_cache_create_info pcc_info = { - .internal = true, - }; + struct vk_pipeline_cache_create_info pcc_info = { }; device->default_pipeline_cache = vk_pipeline_cache_create(&device->vk, &pcc_info, NULL); if (!device->default_pipeline_cache) { diff --git a/src/vulkan/runtime/vk_pipeline_cache.c b/src/vulkan/runtime/vk_pipeline_cache.c index 59937d4..b16d5a0 100644 --- a/src/vulkan/runtime/vk_pipeline_cache.c +++ b/src/vulkan/runtime/vk_pipeline_cache.c @@ -38,9 +38,7 @@ #include "util/set.h" #define vk_pipeline_cache_log(cache, ...) \ - if (cache->internal) \ - vk_logw(VK_LOG_OBJS(cache->base.device), __VA_ARGS__); \ - else \ + if (cache->base.client_visible) \ vk_logw(VK_LOG_OBJS(cache), __VA_ARGS__) static bool @@ -590,7 +588,6 @@ vk_pipeline_cache_create(struct vk_device *device, return NULL; cache->flags = pCreateInfo->flags; - cache->internal = info->internal; struct VkPhysicalDeviceProperties pdevice_props; device->physical->dispatch_table.GetPhysicalDeviceProperties( diff --git a/src/vulkan/runtime/vk_pipeline_cache.h b/src/vulkan/runtime/vk_pipeline_cache.h index bdb5f68..8a621ed 100644 --- a/src/vulkan/runtime/vk_pipeline_cache.h +++ b/src/vulkan/runtime/vk_pipeline_cache.h @@ -163,9 +163,6 @@ struct vk_pipeline_cache { /** Protects object_cache */ simple_mtx_t lock; - /* Whether this cache is created by the driver. */ - bool internal; - struct set *object_cache; }; @@ -181,8 +178,6 @@ struct vk_pipeline_cache_create_info { /** If true, ignore VK_ENABLE_PIPELINE_CACHE and enable anyway */ bool force_enable; - - bool internal; }; struct vk_pipeline_cache * -- 2.7.4