vulkan/pipeline_cache: don't log warnings for client-invisible caches
authorDaniel Schürmann <daniel@schuermann.dev>
Fri, 12 May 2023 10:19:14 +0000 (12:19 +0200)
committerMarge Bot <emma+marge@anholt.net>
Wed, 17 May 2023 20:40:12 +0000 (20:40 +0000)
Fixes: d3f06cf5ce0764b37a03a0f2bfbb109a4d75884d ('vulkan/pipeline_cache: don't log warnings for internal caches')
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22986>

src/amd/vulkan/meta/radv_meta.c
src/amd/vulkan/radv_device.c
src/freedreno/vulkan/tu_device.cc
src/intel/vulkan/anv_device.c
src/intel/vulkan_hasvk/anv_device.c
src/vulkan/runtime/vk_pipeline_cache.c
src/vulkan/runtime/vk_pipeline_cache.h

index 0781996..d79c186 100644 (file)
@@ -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;
    }
index cce1251..f5559ba 100644 (file)
@@ -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;
index 53b6128..1ad80b1 100644 (file)
@@ -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 =
index 1c3b9c0..8dc7bea 100644 (file)
@@ -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) {
index d947e9f..af4d759 100644 (file)
@@ -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) {
index 59937d4..b16d5a0 100644 (file)
@@ -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(
index bdb5f68..8a621ed 100644 (file)
@@ -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 *