diff options
| author | Stenzek <stenzek@gmail.com> | 2018-01-21 20:22:45 +1000 |
|---|---|---|
| committer | Stenzek <stenzek@gmail.com> | 2018-03-02 20:20:48 +1000 |
| commit | 4c24a697106471b33973da619a43167c947276aa (patch) | |
| tree | a3c94597cfbffccc30d56ef58fcfefd2183b0126 /Source/Core/VideoBackends/Null/NullTexture.cpp | |
| parent | 2a6d9e4713a9a540684795cb10ee6e6462178ba1 (diff) | |
VideoCommon: Add support for Abstract Framebuffers
Diffstat (limited to 'Source/Core/VideoBackends/Null/NullTexture.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/Null/NullTexture.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Source/Core/VideoBackends/Null/NullTexture.cpp b/Source/Core/VideoBackends/Null/NullTexture.cpp index 55abc0521c..2a21afb4b7 100644 --- a/Source/Core/VideoBackends/Null/NullTexture.cpp +++ b/Source/Core/VideoBackends/Null/NullTexture.cpp @@ -70,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 |
