30#ifndef PipelineCacheManager_h
31#define PipelineCacheManager_h
33#include <vulkan/vulkan_raii.hpp>
42 uint8_t cache_uuid[16];
65 std::shared_ptr< std::vector<uint8_t> >
LookupRaw(
const std::string& key);
66 void StoreRaw(
const std::string& key, std::shared_ptr< std::vector<uint8_t> > value);
68 std::shared_ptr<vk::raii::PipelineCache>
Lookup(
const std::string& key, time_t target);
81 std::map<std::string, std::shared_ptr<vk::raii::PipelineCache> >
m_vkCache;
84 std::map<std::string, std::shared_ptr<std::vector<uint8_t> > >
m_rawDataCache;
93extern std::unique_ptr<PipelineCacheManager> g_pipelineCacheMgr;
Helper for managing Vulkan / vkFFT pipeline cache objects.
Definition: PipelineCacheManager.h:60
std::map< std::string, std::shared_ptr< std::vector< uint8_t > > > m_rawDataCache
The actual cache data store.
Definition: PipelineCacheManager.h:84
~PipelineCacheManager()
Destroys the cache and writes it out to disk.
Definition: PipelineCacheManager.cpp:63
void Clear()
Removes all content from the cache.
Definition: PipelineCacheManager.cpp:114
void StoreRaw(const std::string &key, std::shared_ptr< std::vector< uint8_t > > value)
Store a raw blob to the cache.
Definition: PipelineCacheManager.cpp:140
std::map< std::string, std::shared_ptr< vk::raii::PipelineCache > > m_vkCache
Vulkan pipeline cache objects.
Definition: PipelineCacheManager.h:81
std::string m_cacheRootDir
Root directory of the cache.
Definition: PipelineCacheManager.h:90
void LoadFromDisk()
Loads cache content from disk.
Definition: PipelineCacheManager.cpp:196
void SaveToDisk()
Writes cache content out to disk.
Definition: PipelineCacheManager.cpp:293
std::shared_ptr< std::vector< uint8_t > > LookupRaw(const std::string &key)
Look up a blob which may or may not be in the cache.
Definition: PipelineCacheManager.cpp:124
std::mutex m_mutex
Mutex to interlock access to the STL containers.
Definition: PipelineCacheManager.h:78
std::map< std::string, time_t > m_vkCacheTimestamps
Modification timestamps of the files.
Definition: PipelineCacheManager.h:87
std::shared_ptr< vk::raii::PipelineCache > Lookup(const std::string &key, time_t target)
Returns a Vulkan pipeline cache object for the given path.
Definition: PipelineCacheManager.cpp:153