]> git.tdb.fi Git - libs/gl.git/blob - source/backends/vulkan/pipelinecache.h
Support multiple PipelineStates in Renderer
[libs/gl.git] / source / backends / vulkan / pipelinecache.h
1 #ifndef MSP_GL_VULKAN_PIPELINECACHE_H_
2 #define MSP_GL_VULKAN_PIPELINECACHE_H_
3
4 #include <cstdint>
5 #include <map>
6 #include "frameformat.h"
7 #include "handles.h"
8
9 namespace Msp {
10 namespace GL {
11
12 class Device;
13 class PipelineState;
14
15 class PipelineCache
16 {
17 private:
18         Device &device;
19         VkDescriptorPool descriptor_pool;
20         std::map<std::uint64_t, VkRenderPass> render_passes;
21         std::map<std::uint64_t, VkPipeline> pipelines;
22         std::map<std::uint64_t, VkDescriptorSet> descriptor_sets;
23
24 public:
25         PipelineCache(Device &);
26         PipelineCache(PipelineCache &&);
27         ~PipelineCache();
28
29         VkRenderPass get_render_pass(const FrameFormat &, bool, bool, bool);
30         VkPipeline get_pipeline(const PipelineState &);
31         VkDescriptorSet get_descriptor_set(const PipelineState &, unsigned);
32 };
33
34 } // namespace GL
35 } // namespace Msp
36
37 #endif