X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Fbackends%2Fvulkan%2Fpipelinestate_backend.h;fp=source%2Fbackends%2Fvulkan%2Fpipelinestate_backend.h;h=d7ef4a20bf97483ade9b2c818228d59352e2628e;hb=99ca354f18119f82f1adeca100cd665a8f640317;hp=0000000000000000000000000000000000000000;hpb=4cd245dafe6a7ee5c93edca5aee2d146f1155309;p=libs%2Fgl.git diff --git a/source/backends/vulkan/pipelinestate_backend.h b/source/backends/vulkan/pipelinestate_backend.h new file mode 100644 index 00000000..d7ef4a20 --- /dev/null +++ b/source/backends/vulkan/pipelinestate_backend.h @@ -0,0 +1,42 @@ +#ifndef MSP_GL_PIPELINESTATE_BACKEND_H_ +#define MSP_GL_PIPELINESTATE_BACKEND_H_ + +#include +#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 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 &) const; + std::uint64_t compute_descriptor_set_hash(unsigned) const; + VkDescriptorSetLayout get_descriptor_set_layout(unsigned) const; + unsigned fill_descriptor_writes(unsigned, std::vector &) const; + + void apply(VkCommandBuffer) const; +}; + +using PipelineStateBackend = VulkanPipelineState; + +} // namespace GL +} // namespace Msp + +#endif