disabled vulkan pipeline state cache because it's slower than not using it

This commit is contained in:
Turánszki János
2025-05-28 17:46:57 +02:00
parent 916f1bfec0
commit 708f709ffd
2 changed files with 16 additions and 11 deletions
+15 -10
View File
@@ -1,5 +1,8 @@
#include "wiGraphicsDevice_Vulkan.h"
// pipeline state cache can be enabled here for Vulkan, but now it seems slower than not using it, so it's disabled by default:
//#define VULKAN_PIPELINE_CACHE_ENABLED
#ifdef WICKEDENGINE_BUILD_VULKAN
#include "wiVersion.h"
#include "wiTimer.h"
@@ -3459,6 +3462,7 @@ using namespace vulkan_internal;
allocationhandler->bindlessAccelerationStructures.init(this, VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR, 32);
}
#ifdef VULKAN_PIPELINE_CACHE_ENABLED
// Pipeline Cache
{
// Try to read pipeline cache file if exists.
@@ -3505,7 +3509,7 @@ using namespace vulkan_internal;
badCache = true;
}
if (memcmp(pipelineCacheUUID, properties2.properties.pipelineCacheUUID, sizeof(pipelineCacheUUID)) != 0)
if (std::memcmp(pipelineCacheUUID, properties2.properties.pipelineCacheUUID, sizeof(pipelineCacheUUID)) != 0)
{
badCache = true;
}
@@ -3524,6 +3528,7 @@ using namespace vulkan_internal;
// Create Vulkan pipeline cache
vulkan_check(vkCreatePipelineCache(device, &createInfo, nullptr, &pipelineCache));
}
#endif
// Static samplers:
{
@@ -7505,16 +7510,16 @@ using namespace vulkan_internal;
}
allocationhandler->destroylocker.unlock();
// Destroy Vulkan pipeline cache
vkDestroyPipelineCache(device, pipelineCache, nullptr);
pipelineCache = VK_NULL_HANDLE;
if (pipelineCache != VK_NULL_HANDLE)
{
vkDestroyPipelineCache(device, pipelineCache, nullptr);
pipelineCache = VK_NULL_HANDLE;
VkPipelineCacheCreateInfo createInfo{ VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO };
createInfo.initialDataSize = 0;
createInfo.pInitialData = nullptr;
// Create Vulkan pipeline cache
vulkan_check(vkCreatePipelineCache(device, &createInfo, nullptr, &pipelineCache));
VkPipelineCacheCreateInfo createInfo{ VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO };
createInfo.initialDataSize = 0;
createInfo.pInitialData = nullptr;
vulkan_check(vkCreatePipelineCache(device, &createInfo, nullptr, &pipelineCache));
}
}
Texture GraphicsDevice_Vulkan::GetBackBuffer(const SwapChain* swapchain) const
+1 -1
View File
@@ -9,7 +9,7 @@ namespace wi::version
// minor features, major updates, breaking compatibility changes
const int minor = 71;
// minor bug fixes, alterations, refactors, updates
const int revision = 781;
const int revision = 782;
const std::string version_string = std::to_string(major) + "." + std::to_string(minor) + "." + std::to_string(revision);