]> git.tdb.fi Git - libs/gl.git/blob - source/backends/vulkan/framebuffer_backend.h
Create image views in VulkanFramebuffer if necessary
[libs/gl.git] / source / backends / vulkan / framebuffer_backend.h
1 #ifndef MSP_GL_FRAMEBUFFER_BACKEND_H_
2 #define MSP_GL_FRAMEBUFFER_BACKEND_H_
3
4 #include <string>
5 #include "frameformat.h"
6 #include "handles.h"
7
8 namespace Msp {
9 namespace GL {
10
11 class Device;
12 class Texture;
13
14 class VulkanFramebuffer: public NonCopyable
15 {
16         friend class VulkanCommands;
17         friend class VulkanPipelineState;
18
19 protected:
20         Device &device;
21         mutable VkFramebuffer handle = 0;
22         mutable std::vector<VkImageView> view_handles;
23         std::string debug_name;
24
25         VulkanFramebuffer(bool);
26         VulkanFramebuffer(VulkanFramebuffer &&);
27         ~VulkanFramebuffer();
28
29         bool is_format_supported(const FrameFormat &);
30         static void require_layered() { }
31
32         void update(unsigned) const;
33         void require_complete() const { }
34
35         void prepare_image_layouts(bool = false) const;
36
37         void set_debug_name(const std::string &);
38         void set_vulkan_object_name() const;
39 };
40
41 using FramebufferBackend = VulkanFramebuffer;
42
43 } // namespace GL
44 } // namespace Msp
45
46 #endif