| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
#pragma once |
| 5 |
|
| 6 |
#include <memory> |
| 7 |
#include <vector> |
| 8 |
|
| 9 |
#include "Common/CommonTypes.h" |
| 10 |
|
| 11 |
#include "VideoCommon/AbstractFramebuffer.h" |
| 12 |
#include "VideoCommon/AbstractStagingTexture.h" |
| 13 |
#include "VideoCommon/AbstractTexture.h" |
| 14 |
|
| 15 |
namespace Null |
| 16 |
{ |
| 17 |
class NullTexture final : public AbstractTexture |
| 18 |
{ |
| 19 |
public: |
| 20 |
explicit NullTexture(const TextureConfig& config); |
| 21 |
|
| 22 |
void CopyRectangleFromTexture(const AbstractTexture* src, |
| 23 |
const MathUtil::Rectangle<int>& src_rect, u32 src_layer, |
| 24 |
u32 src_level, const MathUtil::Rectangle<int>& dst_rect, |
| 25 |
u32 dst_layer, u32 dst_level) override; |
| 26 |
void ResolveFromTexture(const AbstractTexture* src, const MathUtil::Rectangle<int>& rect, |
| 27 |
u32 layer, u32 level) override; |
| 28 |
void Load(u32 level, u32 width, u32 height, u32 row_length, const u8* buffer, size_t buffer_size, |
| 29 |
u32 layer) override; |
| 30 |
}; |
| 31 |
|
| 32 |
class NullStagingTexture final : public AbstractStagingTexture |
| 33 |
{ |
| 34 |
public: |
| 35 |
explicit NullStagingTexture(StagingTextureType type, const TextureConfig& config); |
| 36 |
~NullStagingTexture() override; |
| 37 |
|
| 38 |
void CopyFromTexture(const AbstractTexture* src, const MathUtil::Rectangle<int>& src_rect, |
| 39 |
u32 src_layer, u32 src_level, |
| 40 |
const MathUtil::Rectangle<int>& dst_rect) override; |
| 41 |
void CopyToTexture(const MathUtil::Rectangle<int>& src_rect, AbstractTexture* dst, |
| 42 |
const MathUtil::Rectangle<int>& dst_rect, u32 dst_layer, |
| 43 |
u32 dst_level) override; |
| 44 |
|
| 45 |
bool Map() override; |
| 46 |
void Unmap() override; |
| 47 |
void Flush() override; |
| 48 |
|
| 49 |
private: |
| 50 |
std::vector<u8> m_texture_buf; |
| 51 |
}; |
| 52 |
|
| 53 |
class NullFramebuffer final : public AbstractFramebuffer |
| 54 |
{ |
| 55 |
public: |
| 56 |
explicit NullFramebuffer(AbstractTexture* color_attachment, AbstractTexture* depth_attachment, |
| 57 |
std::vector<AbstractTexture*> additional_color_attachments, |
| 58 |
AbstractTextureFormat color_format, AbstractTextureFormat depth_format, |
| 59 |
u32 width, u32 height, u32 layers, u32 samples); |
| 60 |
|
| 61 |
static std::unique_ptr<NullFramebuffer> |
| 62 |
Create(NullTexture* color_attachment, NullTexture* depth_attachment, |
| 63 |
std::vector<AbstractTexture*> additional_color_attachments); |
| 64 |
}; |
| 65 |
|
| 66 |
} |