From 4a615924f817506c86070099b9c57bb53624d5bb Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Fri, 4 Aug 2023 02:17:27 +0200 Subject: [PATCH] Improve warning messages related to Vulkan pipeline cache This gives better explanations on why the cache may have been invalidated, along with usual consequences. These messages have also been moved to verbose prints, as users cannot do anything to resolve them specifically (so they are mostly relevant to developers). --- drivers/vulkan/rendering_device_driver_vulkan.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/vulkan/rendering_device_driver_vulkan.cpp b/drivers/vulkan/rendering_device_driver_vulkan.cpp index 1906d168fe5..f7d3782d751 100644 --- a/drivers/vulkan/rendering_device_driver_vulkan.cpp +++ b/drivers/vulkan/rendering_device_driver_vulkan.cpp @@ -3814,11 +3814,11 @@ bool RenderingDeviceDriverVulkan::pipeline_cache_create(const Vector &p if (p_data.is_empty()) { // No pre-existing cache, just create it. } else if (p_data.size() <= (int)sizeof(PipelineCacheHeader)) { - WARN_PRINT("Invalid/corrupt pipelines cache."); + print_verbose("Invalid/corrupt Vulkan pipelines cache. Existing shader pipeline cache will be ignored, which may result in stuttering during gameplay."); } else { const PipelineCacheHeader *loaded_header = reinterpret_cast(p_data.ptr()); if (loaded_header->magic != 868 + VK_PIPELINE_CACHE_HEADER_VERSION_ONE) { - WARN_PRINT("Invalid pipelines cache magic number."); + print_verbose("Invalid Vulkan pipelines cache magic number. Existing shader pipeline cache will be ignored, which may result in stuttering during gameplay."); } else { const uint8_t *loaded_buffer_start = p_data.ptr() + sizeof(PipelineCacheHeader); uint32_t loaded_buffer_size = p_data.size() - sizeof(PipelineCacheHeader); @@ -3830,7 +3830,7 @@ bool RenderingDeviceDriverVulkan::pipeline_cache_create(const Vector &p loaded_header->driver_version != current_header->driver_version || memcmp(loaded_header->uuid, current_header->uuid, VK_UUID_SIZE) != 0 || loaded_header->driver_abi != current_header->driver_abi) { - WARN_PRINT("Invalid pipelines cache header."); + print_verbose("Invalid Vulkan pipelines cache header. This may be due to an engine change, GPU change or graphics driver version change. Existing shader pipeline cache will be ignored, which may result in stuttering during gameplay."); } else { pipelines_cache.current_size = loaded_buffer_size; pipelines_cache.buffer = p_data;