]> git.tdb.fi Git - libs/gl.git/blob - source/backends/vulkan/program_backend.h
Initial implementation of Vulkan backend
[libs/gl.git] / source / backends / vulkan / program_backend.h
1 #ifndef MSP_GL_PROGRAM_BACKEND_H_
2 #define MSP_GL_PROGRAM_BACKEND_H_
3
4 #include <map>
5 #include <string>
6 #include <vector>
7 #include <msp/core/noncopyable.h>
8 #include "reflectdata.h"
9
10 namespace Msp {
11 namespace GL {
12
13 class Device;
14
15 class VulkanProgram: public NonCopyable
16 {
17         friend class VulkanPipelineState;
18
19 protected:
20         struct TransientData
21         { };
22
23         Device &device;
24         unsigned n_stages = 0;
25         std::vector<char> creation_info;
26         std::vector<VkDescriptorSetLayout> desc_set_layout_handles;
27         VkPipelineLayout layout_handle = 0;
28
29         VulkanProgram();
30         VulkanProgram(VulkanProgram &&);
31         ~VulkanProgram();
32
33         bool has_stages() const;
34         void add_glsl_stages(const GlslModule &, const std::map<std::string, int> &, TransientData &);
35         void add_spirv_stages(const SpirVModule &, const std::map<std::string, int> &);
36
37         void finalize(const Module &, TransientData &) { }
38         void finalize_uniforms();
39
40         void set_debug_name(const std::string &) { }
41 };
42
43 using ProgramBackend = VulkanProgram;
44
45 } // namespace GL
46 } // namespace Msp
47
48 #endif