]> git.tdb.fi Git - libs/gl.git/blob - source/backends/vulkan/framebuffer_backend.h
be336a97a7e62bc4fd011d98bed9d9aa89109ac7
[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 RenderPass;
17         friend class VulkanCommands;
18         friend class VulkanPipelineState;
19
20 protected:
21         Device &device;
22         mutable VkFramebuffer handle = 0;
23         mutable std::vector<VkImageView> view_handles;
24         std::string debug_name;
25
26         VulkanFramebuffer(bool);
27         VulkanFramebuffer(VulkanFramebuffer &&);
28         ~VulkanFramebuffer();
29
30         bool is_format_supported(const FrameFormat &) const;
31         void format_changed(const FrameFormat &) { }
32         static void require_layered() { }
33
34         bool is_presentable() const;
35
36         void update(unsigned) const;
37         void require_complete() const { }
38
39         void prepare_image_layouts(bool = false) const;
40
41         void set_debug_name(const std::string &);
42         void set_vulkan_object_name() const;
43 };
44
45 using FramebufferBackend = VulkanFramebuffer;
46
47 } // namespace GL
48 } // namespace Msp
49
50 #endif