1 #ifndef MSP_GL_TEXTURE_BACKEND_H_
2 #define MSP_GL_TEXTURE_BACKEND_H_
4 #include <msp/core/noncopyable.h>
12 class VulkanTexture: public NonCopyable
14 friend class VulkanFramebuffer;
15 friend class VulkanPipelineState;
20 VkImageView view_handle = 0;
21 mutable std::vector<VkImageView> mip_view_handles;
22 unsigned memory_id = 0;
24 std::string debug_name;
26 VulkanTexture(unsigned);
27 VulkanTexture(VulkanTexture &&);
31 virtual void fill_image_info(void *) const = 0;
32 VkImageView create_view(int) const;
33 void create_mip_views() const;
34 void require_swizzle() { }
36 void generate_mipmap();
37 virtual void fill_mipmap_blit(unsigned, void *) = 0;
39 void change_layout(int, unsigned, bool) const;
41 void refresh_mip_views() const { if(mip_view_handles.empty()) create_mip_views(); }
43 void set_debug_name(const std::string &);
44 void set_vulkan_object_names() const;
47 using TextureBackend = VulkanTexture;