Add automatic periodic Vulkan Pipeline State Cache serialization

This commit is contained in:
Wojtek Figat
2025-08-12 10:25:02 +02:00
parent b4d501cd6a
commit cdff7708fb
3 changed files with 58 additions and 15 deletions

View File

@@ -113,6 +113,7 @@ ComputePipelineStateVulkan* GPUShaderProgramCSVulkan::GetOrCreateState()
// Create pipeline object
VkPipeline pipeline;
VkResult result = vkCreateComputePipelines(_device->Device, _device->PipelineCache, 1, &desc, nullptr, &pipeline);
_device->PipelineCacheUsage++;
LOG_VULKAN_RESULT(result);
if (result != VK_SUCCESS)
return nullptr;
@@ -313,6 +314,7 @@ VkPipeline GPUPipelineStateVulkan::GetState(RenderPassVulkan* renderPass, GPUVer
auto depthWrite = _descDepthStencil.depthWriteEnable;
_descDepthStencil.depthWriteEnable &= renderPass->CanDepthWrite ? 1 : 0;
const VkResult result = vkCreateGraphicsPipelines(_device->Device, _device->PipelineCache, 1, &_desc, nullptr, &pipeline);
_device->PipelineCacheUsage++;
_descDepthStencil.depthWriteEnable = depthWrite;
LOG_VULKAN_RESULT(result);
if (result != VK_SUCCESS)