]> git.tdb.fi Git - libs/gl.git/blob - source/backends/vulkan/vertexsetup_backend.h
Initial implementation of Vulkan backend
[libs/gl.git] / source / backends / vulkan / vertexsetup_backend.h
1 #ifndef MSP_GL_VERTEXSETUP_BACKEND_H_
2 #define MSP_GL_VERTEXSETUP_BACKEND_H_
3
4 #include <cstdint>
5 #include <vector>
6 #include <msp/core/noncopyable.h>
7 #include "handles.h"
8
9 namespace Msp {
10 namespace GL {
11
12 class VertexArray;
13 class VertexFormat;
14
15 class VulkanVertexSetup: public NonCopyable
16 {
17         friend class VulkanPipelineState;
18
19 protected:
20         mutable std::vector<char> creation_info;
21         mutable std::uint32_t n_bindings;
22         mutable VkBuffer buffers[2];
23         mutable std::uint64_t offsets[2];
24
25         VulkanVertexSetup() = default;
26         VulkanVertexSetup(VulkanVertexSetup &&);
27         ~VulkanVertexSetup() = default;
28
29         static void require_format(const VertexFormat &, bool) { }
30         void update(unsigned) const;
31         void update_attributes(const VertexFormat &, unsigned, void *) const;
32         std::uint64_t compute_hash() const;
33
34         void unload() { }
35
36         void set_debug_name(const std::string &) { }
37 };
38
39 using VertexSetupBackend = VulkanVertexSetup;
40
41 } // namespace GL
42 } // namespace Msp
43
44 #endif