From 6374a4c4a80e88eea2e5914fb84e393c91ec65af Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sun, 21 Jan 2018 15:03:06 +1000 Subject: AbstractTexture: Support multisampled abstract texture --- Source/Core/VideoBackends/Software/SWTexture.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Source/Core/VideoBackends/Software/SWTexture.cpp') diff --git a/Source/Core/VideoBackends/Software/SWTexture.cpp b/Source/Core/VideoBackends/Software/SWTexture.cpp index 5fbd816bad..967474916f 100644 --- a/Source/Core/VideoBackends/Software/SWTexture.cpp +++ b/Source/Core/VideoBackends/Software/SWTexture.cpp @@ -86,6 +86,10 @@ void SWTexture::ScaleRectangleFromTexture(const AbstractTexture* source, memcpy(GetData(), destination_pixels.data(), destination_pixels.size()); } } +void SWTexture::ResolveFromTexture(const AbstractTexture* src, const MathUtil::Rectangle& rect, + u32 layer, u32 level) +{ +} void SWTexture::Load(u32 level, u32 width, u32 height, u32 row_length, const u8* buffer, size_t buffer_size) -- cgit v1.2.3 From 4c24a697106471b33973da619a43167c947276aa Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sun, 21 Jan 2018 20:22:45 +1000 Subject: VideoCommon: Add support for Abstract Framebuffers --- Source/Core/VideoBackends/Software/SWTexture.cpp | 27 ++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'Source/Core/VideoBackends/Software/SWTexture.cpp') diff --git a/Source/Core/VideoBackends/Software/SWTexture.cpp b/Source/Core/VideoBackends/Software/SWTexture.cpp index 967474916f..78f083f768 100644 --- a/Source/Core/VideoBackends/Software/SWTexture.cpp +++ b/Source/Core/VideoBackends/Software/SWTexture.cpp @@ -152,4 +152,31 @@ void SWStagingTexture::Flush() { m_needs_flush = false; } + +SWFramebuffer::SWFramebuffer(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 SWFramebuffer::Create(const SWTexture* color_attachment, + const SWTexture* 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 SWTexture* 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(color_format, depth_format, width, height, layers, + samples); +} + } // namespace SW -- cgit v1.2.3