4#include "graphics/GPUObjects.hpp"
6#include <unordered_map>
72 using GraphicCache = std::unordered_map<const Program*, ProgramPipelines>;
73 using ComputeCache = std::unordered_map<const Program*, VkPipeline>;
Internal GPU state ; not all API options are exposed, only these that can be toggled in Rendu.
Definition: GPUTypes.hpp:324
Create and reuse GPU pipelines based on a given state. This supports both graphics and compute pipeli...
Definition: PipelineCache.hpp:18
VkPipeline buildGraphicsPipeline(const GPUState &state)
Definition: PipelineCache.cpp:175
GraphicCache _graphicPipelines
Graphics pipeline cache.
Definition: PipelineCache.hpp:75
std::unordered_multimap< uint64_t, Entry > ProgramPipelines
Per program pipeline type.
Definition: PipelineCache.hpp:71
std::unordered_map< const Program *, ProgramPipelines > GraphicCache
Complete cache type.
Definition: PipelineCache.hpp:72
std::deque< PipelineToDelete > _pipelinesToDelete
List of pipelines to delete once we are sure they are unused.
Definition: PipelineCache.hpp:85
void clean()
Definition: PipelineCache.cpp:133
VkPipeline createNewPipeline(const GPUState &state, const uint64_t hash)
Definition: PipelineCache.cpp:165
std::unordered_map< const Program *, VkPipeline > ComputeCache
Complete cache type.
Definition: PipelineCache.hpp:73
VkPipeline getGraphicsPipeline(const GPUState &state)
Definition: PipelineCache.cpp:27
VkPipelineCache _vulkanCache
Vulkan pipeline cache.
Definition: PipelineCache.hpp:77
ComputeCache _computePipelines
Compute pipeline cache.
Definition: PipelineCache.hpp:76
void init()
Definition: PipelineCache.cpp:11
void freeOutdatedPipelines()
Destroy pipelines that are referencing outdated state and are not used anymore.
Definition: PipelineCache.cpp:111
VkPipeline getComputePipeline(const GPUState &state)
Definition: PipelineCache.cpp:83
VkPipeline buildComputePipeline(Program &program)
Definition: PipelineCache.cpp:455
Represents a group of shaders used for rendering.
Definition: Program.hpp:31
Internal GPU state for pipeline compatibility.
Definition: GPUObjects.hpp:162
Current rendering pass information.
Definition: GPUTypes.hpp:328
Store a pipeline along with part of the information used to generate it.
Definition: PipelineCache.hpp:46
VkPipeline pipeline
The native handle.
Definition: PipelineCache.hpp:47
GPUState::RenderPass pass
The attachments layout.
Definition: PipelineCache.hpp:49
GPUMesh::State mesh
The mesh layout.
Definition: PipelineCache.hpp:48
Information for buffered pipeline deletion.
Definition: PipelineCache.hpp:80
VkPipeline pipeline
The native handle.
Definition: PipelineCache.hpp:81
uint64_t frame
The frame at which the deletion request was created.
Definition: PipelineCache.hpp:82