mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-27 17:13:52 +00:00
perf: add Vulkan pipeline cache persistence for faster startup
Create a VkPipelineCache at device init, loaded from disk if available. All 65 pipeline creation calls across 19 renderer files now use the shared cache. On shutdown, the cache is serialized to disk so subsequent launches skip redundant shader compilation. Cache path: ~/.local/share/wowee/pipeline_cache.bin (Linux), ~/Library/Caches/wowee/ (macOS), %APPDATA%\wowee\ (Windows). Stale/corrupt caches are handled gracefully (fallback to empty cache).
This commit is contained in:
parent
c18720f0f0
commit
c8c01f8ac0
23 changed files with 192 additions and 72 deletions
|
|
@ -107,7 +107,7 @@ bool Lightning::initialize(VkContext* ctx, VkDescriptorSetLayout perFrameLayout)
|
|||
.setLayout(boltPipelineLayout)
|
||||
.setRenderPass(vkCtx->getImGuiRenderPass())
|
||||
.setDynamicStates(dynamicStates)
|
||||
.build(device);
|
||||
.build(device, vkCtx->getPipelineCache());
|
||||
|
||||
vertModule.destroy();
|
||||
fragModule.destroy();
|
||||
|
|
@ -169,7 +169,7 @@ bool Lightning::initialize(VkContext* ctx, VkDescriptorSetLayout perFrameLayout)
|
|||
.setLayout(flashPipelineLayout)
|
||||
.setRenderPass(vkCtx->getImGuiRenderPass())
|
||||
.setDynamicStates(dynamicStates)
|
||||
.build(device);
|
||||
.build(device, vkCtx->getPipelineCache());
|
||||
|
||||
vertModule.destroy();
|
||||
fragModule.destroy();
|
||||
|
|
@ -306,7 +306,7 @@ void Lightning::recreatePipelines() {
|
|||
.setLayout(boltPipelineLayout)
|
||||
.setRenderPass(vkCtx->getImGuiRenderPass())
|
||||
.setDynamicStates(dynamicStates)
|
||||
.build(device);
|
||||
.build(device, vkCtx->getPipelineCache());
|
||||
|
||||
vertModule.destroy();
|
||||
fragModule.destroy();
|
||||
|
|
@ -344,7 +344,7 @@ void Lightning::recreatePipelines() {
|
|||
.setLayout(flashPipelineLayout)
|
||||
.setRenderPass(vkCtx->getImGuiRenderPass())
|
||||
.setDynamicStates(dynamicStates)
|
||||
.build(device);
|
||||
.build(device, vkCtx->getPipelineCache());
|
||||
|
||||
vertModule.destroy();
|
||||
fragModule.destroy();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue