1 #ifndef MSP_GL_PIPELINESTATE_BACKEND_H_
2 #define MSP_GL_PIPELINESTATE_BACKEND_H_
4 #include <msp/core/noncopyable.h>
12 class VulkanPipelineState: public NonCopyable
14 friend class PipelineCache;
15 friend class VulkanCommands;
19 mutable unsigned changes = 0;
20 mutable VkPipeline handle;
21 mutable std::vector<VkDescriptorSet> descriptor_set_handles;
23 VulkanPipelineState();
24 VulkanPipelineState(VulkanPipelineState &&);
26 static bool can_bind_tex_level(unsigned) { return true; }
29 void refresh() const { if(changes) update(); }
30 std::uint64_t compute_hash() const;
31 void fill_creation_info(std::vector<char> &) const;
32 std::uint64_t compute_descriptor_set_hash(unsigned) const;
33 VkDescriptorSetLayout get_descriptor_set_layout(unsigned) const;
34 unsigned fill_descriptor_writes(unsigned, std::vector<char> &) const;
36 void apply(VkCommandBuffer, bool) const;
39 using PipelineStateBackend = VulkanPipelineState;