]> git.tdb.fi Git - libs/gl.git/blob - source/backends/vulkan/texture_backend.h
Initial implementation of Vulkan backend
[libs/gl.git] / source / backends / vulkan / texture_backend.h
1 #ifndef MSP_GL_TEXTURE_BACKEND_H_
2 #define MSP_GL_TEXTURE_BACKEND_H_
3
4 #include <msp/core/noncopyable.h>
5 #include "handles.h"
6
7 namespace Msp {
8 namespace GL {
9
10 class Device;
11
12 class VulkanTexture: public NonCopyable
13 {
14         friend class VulkanFramebuffer;
15         friend class VulkanPipelineState;
16
17 protected:
18         Device &device;
19         VkImage handle = 0;
20         VkImageView view_handle = 0;
21         unsigned view_type;
22         std::string debug_name;
23
24         VulkanTexture(unsigned);
25         VulkanTexture(VulkanTexture &&);
26         ~VulkanTexture();
27
28         void allocate();
29         void require_swizzle() { }
30
31         void generate_mipmap();
32
33         void set_debug_name(const std::string &);
34         void set_vulkan_object_names() const;
35 };
36
37 using TextureBackend = VulkanTexture;
38
39 } // namespace GL
40 } // namespace Msp
41
42 #endif