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 DescriptorPool;
15 friend class PipelineCache;
16 friend class VulkanCommands;
20 mutable unsigned changes = 0;
21 mutable unsigned unapplied = 0;
22 mutable VkPipeline handle;
23 mutable std::vector<unsigned> descriptor_set_slots;
25 VulkanPipelineState();
26 VulkanPipelineState(VulkanPipelineState &&);
28 static bool can_bind_tex_level(unsigned) { return true; }
31 void refresh() const { if(changes) update(); }
32 std::uint64_t compute_hash() const;
33 void fill_creation_info(std::vector<char> &) const;
34 std::uint64_t compute_descriptor_set_hash(unsigned) const;
35 bool is_descriptor_set_dynamic(unsigned) const;
36 VkDescriptorSetLayout get_descriptor_set_layout(unsigned) const;
37 unsigned fill_descriptor_writes(unsigned, unsigned, std::vector<char> &) const;
39 void apply(VkCommandBuffer, const VulkanPipelineState *, unsigned, bool) const;
42 using PipelineStateBackend = VulkanPipelineState;