]> git.tdb.fi Git - libs/gl.git/blob - source/backends/vulkan/texture2d_backend.h
Add an asynchronous version of Texture2D::sub_image
[libs/gl.git] / source / backends / vulkan / texture2d_backend.h
1 #ifndef MSP_GL_TEXTURE2D_BACKEND_H_
2 #define MSP_GL_TEXTURE2D_BACKEND_H_
3
4 #include "texture.h"
5
6 namespace Msp {
7 namespace GL {
8
9 class VulkanTexture2D: public Texture
10 {
11 protected:
12         class AsyncTransfer: public NonCopyable
13         {
14         protected:
15                 AsyncTransfer() = default;
16                 AsyncTransfer(AsyncTransfer &&) { }
17                 AsyncTransfer &operator=(AsyncTransfer &&) { return *this; }
18
19                 void *allocate();
20                 void finalize();
21         };
22
23         VulkanTexture2D();
24
25         virtual void fill_image_info(void *) const;
26         void sub_image(unsigned, int, int, unsigned, unsigned, const void *);
27         virtual void fill_mipmap_blit(unsigned, void *);
28
29 public:
30         virtual Resource::AsyncLoader *load(IO::Seekable &, const Resources * = 0);
31         virtual std::size_t get_data_size() const;
32         virtual void unload();
33 };
34
35 using Texture2DBackend = VulkanTexture2D;
36
37 } // namespace GL
38 } // namespace Msp
39
40 #endif