]> git.tdb.fi Git - libs/gl.git/blob - source/backends/vulkan/program_backend.h
16cf7b27f9756c0dca5e4662784419e36f91766c
[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         std::string debug_name;
30
31         VulkanProgram();
32         VulkanProgram(VulkanProgram &&);
33         ~VulkanProgram();
34
35         bool has_stages() const;
36         void add_glsl_stages(const GlslModule &, const std::map<std::string, int> &);
37         void add_spirv_stages(const SpirVModule &, const std::map<std::string, int> &);
38
39         void finalize_uniforms();
40
41         void set_debug_name(const std::string &);
42         void set_vulkan_object_name() const;
43 };
44
45 using ProgramBackend = VulkanProgram;
46
47 } // namespace GL
48 } // namespace Msp
49
50 #endif