10#include "evan/EvanPlatform.hpp"
12#include <utility/logging/loggable.hpp>
13#include <utility/logging/default_logger.hpp>
48 protected utility::logging::Loggable<PipelineCache,
49 utility::logging::DefaultLogger>
88 const std::vector<std::byte> &
blob,
101 std::vector<std::byte> &
blob);
116 const std::vector<std::byte> &
blob);
137 const std::filesystem::path &
path);
193 std::filesystem::path _path;
Owns the Vulkan pipeline cache used when creating pipelines and persists it across runs.
VkPipelineCache getHandle() const
Retrieves the Vulkan handle to pass to vkCreateGraphicsPipelines.
void persist()
Flushes the pipeline cache to the path given to init().
static VkPipelineCacheHeaderVersionOne buildHeader(const VkPhysicalDeviceProperties &properties)
Builds the cache key of a physical device.
void init(VkDevice device, VkPhysicalDevice physicalDevice, const std::filesystem::path &path)
Creates the Vulkan pipeline cache.
void destroy(VkDevice device)
Destroys the Vulkan pipeline cache.
bool isPersistent() const
Tells whether the cache is written to and read from disk.
static bool writeBlob(const std::filesystem::path &path, const std::vector< std::byte > &blob)
Writes a pipeline cache blob to disk atomically.
static bool isBlobCompatible(const std::vector< std::byte > &blob, const VkPipelineCacheHeaderVersionOne &expected)
Tells whether a blob can safely be handed to the driver.
static bool readBlob(const std::filesystem::path &path, std::vector< std::byte > &blob)
Reads a whole pipeline cache blob from disk.
Small result wrapper used by helpers that must return both a status and a value (e....