graphics: checkpoint live Vulkan pipeline cache after new compilations

Co-authored-by: fxpw <fxpw@outlook.com>
This commit is contained in:
nmzik
2026-10-15 12:44:22 +02:00
parent 232e2f2593
commit 959bee4799
2 changed files with 29 additions and 6 deletions
@@ -8,6 +8,7 @@
#include "graphics/host_gpu/vulkanCommon.h"
#include "graphics/shader/shader.h"
#include <chrono>
#include <cstddef>
#include <filesystem>
#include <memory>
@@ -173,11 +174,14 @@ private:
std::unique_ptr<ProgramCache> m_program_cache;
vk::PipelineCache m_driver_cache = nullptr;
std::filesystem::path m_driver_cache_path;
std::chrono::steady_clock::time_point m_next_driver_cache_save;
bool m_driver_cache_dirty = false;
std::unordered_map<GraphicsPipelineKey, std::unique_ptr<Pipeline>, GraphicsPipelineKeyHash>
m_graphics_pipelines;
std::unordered_map<uint64_t, std::unique_ptr<Pipeline>> m_compute_pipelines;
void InitializeDriverCache();
void CheckpointDriverCache();
};
void LogPipelineTrace(const char* phase, uint64_t vertex_program_id, uint64_t pixel_program_id);