]> git.tdb.fi Git - libs/gl.git/blob - source/backends/vulkan/program_backend.h
Simplify Program by removing transient data
[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         unsigned stage_flags = 0;
26         std::vector<char> creation_info;
27         std::vector<VkDescriptorSetLayout> desc_set_layout_handles;
28         VkPipelineLayout layout_handle = 0;
29
30         VulkanProgram();
31         VulkanProgram(VulkanProgram &&);
32         ~VulkanProgram();
33
34         bool has_stages() const;
35         void add_glsl_stages(const GlslModule &, const std::map<std::string, int> &);
36         void add_spirv_stages(const SpirVModule &, const std::map<std::string, int> &);
37
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