]> git.tdb.fi Git - libs/gl.git/blob - source/backends/vulkan/program_backend.h
Support compute shaders and compute operations
[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         Device &device;
21         unsigned n_stages = 0;
22         unsigned stage_flags = 0;
23         std::vector<char> creation_info;
24         std::vector<VkDescriptorSetLayout> desc_set_layout_handles;
25         VkPipelineLayout layout_handle = 0;
26         std::string debug_name;
27
28         VulkanProgram();
29         VulkanProgram(VulkanProgram &&);
30         ~VulkanProgram();
31
32         bool has_stages() const;
33         void add_glsl_stages(const GlslModule &, const std::map<std::string, int> &);
34         void add_spirv_stages(const SpirVModule &, const std::map<std::string, int> &);
35
36         void finalize_uniforms();
37
38         bool is_compute() const;
39
40         void set_debug_name(const std::string &);
41         void set_vulkan_object_name() const;
42 };
43
44 using ProgramBackend = VulkanProgram;
45
46 } // namespace GL
47 } // namespace Msp
48
49 #endif