ngscopeclient 0.1-dev+51fbda87c
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
PipelineCacheManager Class Reference

Helper for managing Vulkan / vkFFT pipeline cache objects. More...

#include <PipelineCacheManager.h>

Public Member Functions

 ~PipelineCacheManager ()
 Destroys the cache and writes it out to disk.
 
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.
 
void StoreRaw (const std::string &key, std::shared_ptr< std::vector< uint8_t > > value)
 Store a raw blob to the cache.
 
std::shared_ptr< vk::raii::PipelineCache > Lookup (const std::string &key, time_t target)
 Returns a Vulkan pipeline cache object for the given path. More...
 
void LoadFromDisk ()
 Loads cache content from disk.
 
void SaveToDisk ()
 Writes cache content out to disk.
 
void Clear ()
 Removes all content from the cache.
 

Protected Member Functions

void FindPath ()
 

Protected Attributes

std::mutex m_mutex
 Mutex to interlock access to the STL containers.
 
std::map< std::string, std::shared_ptr< vk::raii::PipelineCache > > m_vkCache
 Vulkan pipeline cache objects.
 
std::map< std::string, std::shared_ptr< std::vector< uint8_t > > > m_rawDataCache
 The actual cache data store.
 
std::map< std::string, time_t > m_vkCacheTimestamps
 Modification timestamps of the files.
 
std::string m_cacheRootDir
 Root directory of the cache.
 

Detailed Description

Helper for managing Vulkan / vkFFT pipeline cache objects.

The cache is stored on disk under the .cache/glscopeclient directory on Linux, or FIXME on Windows.

Raw data: $cachedir/shader_raw_[key].bin Vulkan shader data: $cachedir/shader_pipeline_[key].bin

Member Function Documentation

◆ Lookup()

shared_ptr< vk::raii::PipelineCache > PipelineCacheManager::Lookup ( const std::string &  key,
time_t  target 
)

Returns a Vulkan pipeline cache object for the given path.

If not found, a new cache object is created and returned.


The documentation for this class was generated from the following files: