]> git.tdb.fi Git - libs/gl.git/blobdiff - source/backends/vulkan/vertexsetup_backend.h
Initial implementation of Vulkan backend
[libs/gl.git] / source / backends / vulkan / vertexsetup_backend.h
diff --git a/source/backends/vulkan/vertexsetup_backend.h b/source/backends/vulkan/vertexsetup_backend.h
new file mode 100644 (file)
index 0000000..785f5e7
--- /dev/null
@@ -0,0 +1,44 @@
+#ifndef MSP_GL_VERTEXSETUP_BACKEND_H_
+#define MSP_GL_VERTEXSETUP_BACKEND_H_
+
+#include <cstdint>
+#include <vector>
+#include <msp/core/noncopyable.h>
+#include "handles.h"
+
+namespace Msp {
+namespace GL {
+
+class VertexArray;
+class VertexFormat;
+
+class VulkanVertexSetup: public NonCopyable
+{
+       friend class VulkanPipelineState;
+
+protected:
+       mutable std::vector<char> creation_info;
+       mutable std::uint32_t n_bindings;
+       mutable VkBuffer buffers[2];
+       mutable std::uint64_t offsets[2];
+
+       VulkanVertexSetup() = default;
+       VulkanVertexSetup(VulkanVertexSetup &&);
+       ~VulkanVertexSetup() = default;
+
+       static void require_format(const VertexFormat &, bool) { }
+       void update(unsigned) const;
+       void update_attributes(const VertexFormat &, unsigned, void *) const;
+       std::uint64_t compute_hash() const;
+
+       void unload() { }
+
+       void set_debug_name(const std::string &) { }
+};
+
+using VertexSetupBackend = VulkanVertexSetup;
+
+} // namespace GL
+} // namespace Msp
+
+#endif