diff options
| author | Stenzek <stenzek@users.noreply.github.com> | 2018-03-08 00:52:49 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-03-08 00:52:49 +1000 |
| commit | 24a46dc6af007ba5085a0425de7a7937623eb333 (patch) | |
| tree | 05f61d35ff03d15e07455c458ae2069af455264f /Source/Core/VideoBackends/Null/NullTexture.cpp | |
| parent | aee977e32a0054e6a32a750c90c941d979db9d5a (diff) | |
| parent | 4c24a697106471b33973da619a43167c947276aa (diff) | |
Merge pull request #6315 from stenzek/abstract-framebuffers
Abstract Framebuffers
Diffstat (limited to 'Source/Core/VideoBackends/Null/NullTexture.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/Null/NullTexture.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/Source/Core/VideoBackends/Null/NullTexture.cpp b/Source/Core/VideoBackends/Null/NullTexture.cpp index 1bf3ae1470..2a21afb4b7 100644 --- a/Source/Core/VideoBackends/Null/NullTexture.cpp +++ b/Source/Core/VideoBackends/Null/NullTexture.cpp @@ -21,6 +21,10 @@ void NullTexture::ScaleRectangleFromTexture(const AbstractTexture* source, const MathUtil::Rectangle<int>& dstrect) { } +void NullTexture::ResolveFromTexture(const AbstractTexture* src, + const MathUtil::Rectangle<int>& rect, u32 layer, u32 level) +{ +} void NullTexture::Load(u32 level, u32 width, u32 height, u32 row_length, const u8* buffer, size_t buffer_size) @@ -66,4 +70,31 @@ void NullStagingTexture::Flush() m_needs_flush = false; } +NullFramebuffer::NullFramebuffer(AbstractTextureFormat color_format, + AbstractTextureFormat depth_format, u32 width, u32 height, + u32 layers, u32 samples) + : AbstractFramebuffer(color_format, depth_format, width, height, layers, samples) +{ +} + +std::unique_ptr<NullFramebuffer> NullFramebuffer::Create(const NullTexture* color_attachment, + const NullTexture* depth_attachment) +{ + if (!ValidateConfig(color_attachment, depth_attachment)) + return nullptr; + + const AbstractTextureFormat color_format = + color_attachment ? color_attachment->GetFormat() : AbstractTextureFormat::Undefined; + const AbstractTextureFormat depth_format = + depth_attachment ? depth_attachment->GetFormat() : AbstractTextureFormat::Undefined; + const NullTexture* either_attachment = color_attachment ? color_attachment : depth_attachment; + const u32 width = either_attachment->GetWidth(); + const u32 height = either_attachment->GetHeight(); + const u32 layers = either_attachment->GetLayers(); + const u32 samples = either_attachment->GetSamples(); + + return std::make_unique<NullFramebuffer>(color_format, depth_format, width, height, layers, + samples); +} + } // namespace Null |
