LiteFX 0.4.1.2025
Computer Graphics Engine
Loading...
Searching...
No Matches
blitter.hpp
1#pragma once
2
3#include <litefx/graphics_api.hpp>
4#include <litefx/rendering_api.hpp>
5
6#ifdef LITEFX_BUILD_VULKAN_BACKEND
7#include <litefx/backends/vulkan.hpp>
8#endif // LITEFX_BUILD_VULKAN_BACKEND
9
10#ifdef LITEFX_BUILD_DIRECTX_12_BACKEND
11#include <litefx/backends/dx12.hpp>
12#endif // LITEFX_BUILD_DIRECTX_12_BACKEND
13
15 using namespace LiteFX;
16
17 //class IBlitter {
18 // virtual blit(IImage, ICommandBuffer)
19 // virtual generateMipMaps(IImage, ICommandBuffer)
20 //};
21
30 template <render_backend TBackend>
31 class LITEFX_GRAPHICS_API Blitter : public LiteFX::SharedObject {
32 LITEFX_IMPLEMENTATION(BlitImpl);
33 friend struct SharedObject::Allocator<Blitter>;
34
35 private:
40 explicit Blitter(const TBackend::device_type& device);
41
43 Blitter(const Blitter&) = delete;
44
46 Blitter(Blitter&&) noexcept = delete;
47
49 Blitter& operator=(const Blitter&) = delete;
50
52 Blitter& operator=(Blitter&&) noexcept = delete;
53
54 public:
56 ~Blitter() noexcept override = default;
57
58 public:
64 static inline auto create(const TBackend::device_type& device) {
65 return SharedObject::create<Blitter<TBackend>>(device);
66 }
67
68 public:
69 //void blit(TBackend::image_type& image, TBackend::command_buffer_type& commandBuffer
70 void generateMipMaps(TBackend::image_type& image, TBackend::command_buffer_type& commandBuffer) /*override*/;
71 };
72
73#ifdef LITEFX_LINK_SHARED
74#ifdef LITEFX_BUILD_VULKAN_BACKEND
75#ifndef LiteFX_Graphics_EXPORTS
76 template class LITEFX_GRAPHICS_API Blitter<Backends::VulkanBackend>;
77#endif // !LiteFX_Graphics_EXPORTS
78#endif // LITEFX_BUILD_VULKAN_BACKEND
79
80#ifdef LITEFX_BUILD_DIRECTX_12_BACKEND
81#ifndef LiteFX_Graphics_EXPORTS
82 template class LITEFX_GRAPHICS_API Blitter<Backends::DirectX12Backend>;
83#endif // !LiteFX_Graphics_EXPORTS
84#endif // LITEFX_BUILD_DIRECTX_12_BACKEND
85#endif // LITEFX_LINK_SHARED
86
87}
Utility class that can be used to issue blit commands and generate mip maps.
Definition blitter.hpp:31
void generateMipMaps(TBackend::image_type &image, TBackend::command_buffer_type &commandBuffer)
Base class for an object that can be shared.
Definition containers.hpp:1075
Definition blitter.hpp:14
Definition app.hpp:6
An allocator used to allocate the shared object.
Definition containers.hpp:1098