--- /dev/null
+#ifndef MSP_GL_PIPELINESTATE_BACKEND_H_
+#define MSP_GL_PIPELINESTATE_BACKEND_H_
+
+#include <msp/core/noncopyable.h>
+#include "handles.h"
+
+namespace Msp {
+namespace GL {
+
+class Device;
+
+class VulkanPipelineState: public NonCopyable
+{
+ friend class PipelineCache;
+ friend class VulkanCommands;
+
+protected:
+ Device &device;
+ mutable unsigned changes = 0;
+ mutable VkPipeline handle;
+ mutable std::vector<VkDescriptorSet> descriptor_set_handles;
+
+ VulkanPipelineState();
+ VulkanPipelineState(VulkanPipelineState &&);
+
+ void update() const;
+ void refresh() const { if(changes) update(); }
+ std::uint64_t compute_hash() const;
+ void fill_creation_info(std::vector<char> &) const;
+ std::uint64_t compute_descriptor_set_hash(unsigned) const;
+ VkDescriptorSetLayout get_descriptor_set_layout(unsigned) const;
+ unsigned fill_descriptor_writes(unsigned, std::vector<char> &) const;
+
+ void apply(VkCommandBuffer) const;
+};
+
+using PipelineStateBackend = VulkanPipelineState;
+
+} // namespace GL
+} // namespace Msp
+
+#endif