Merge pull request #80232 from Calinou/vulkan-pipeline-cache-improve-messages
Improve warning messages related to Vulkan pipeline cache
This commit is contained in:
commit
68ac4ee358
|
@ -3816,11 +3816,11 @@ bool RenderingDeviceDriverVulkan::pipeline_cache_create(const Vector<uint8_t> &p
|
||||||
if (p_data.is_empty()) {
|
if (p_data.is_empty()) {
|
||||||
// No pre-existing cache, just create it.
|
// No pre-existing cache, just create it.
|
||||||
} else if (p_data.size() <= (int)sizeof(PipelineCacheHeader)) {
|
} 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 {
|
} else {
|
||||||
const PipelineCacheHeader *loaded_header = reinterpret_cast<const PipelineCacheHeader *>(p_data.ptr());
|
const PipelineCacheHeader *loaded_header = reinterpret_cast<const PipelineCacheHeader *>(p_data.ptr());
|
||||||
if (loaded_header->magic != 868 + VK_PIPELINE_CACHE_HEADER_VERSION_ONE) {
|
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 {
|
} else {
|
||||||
const uint8_t *loaded_buffer_start = p_data.ptr() + sizeof(PipelineCacheHeader);
|
const uint8_t *loaded_buffer_start = p_data.ptr() + sizeof(PipelineCacheHeader);
|
||||||
uint32_t loaded_buffer_size = p_data.size() - sizeof(PipelineCacheHeader);
|
uint32_t loaded_buffer_size = p_data.size() - sizeof(PipelineCacheHeader);
|
||||||
|
@ -3832,7 +3832,7 @@ bool RenderingDeviceDriverVulkan::pipeline_cache_create(const Vector<uint8_t> &p
|
||||||
loaded_header->driver_version != current_header->driver_version ||
|
loaded_header->driver_version != current_header->driver_version ||
|
||||||
memcmp(loaded_header->uuid, current_header->uuid, VK_UUID_SIZE) != 0 ||
|
memcmp(loaded_header->uuid, current_header->uuid, VK_UUID_SIZE) != 0 ||
|
||||||
loaded_header->driver_abi != current_header->driver_abi) {
|
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 {
|
} else {
|
||||||
pipelines_cache.current_size = loaded_buffer_size;
|
pipelines_cache.current_size = loaded_buffer_size;
|
||||||
pipelines_cache.buffer = p_data;
|
pipelines_cache.buffer = p_data;
|
||||||
|
|
Loading…
Reference in New Issue