summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/Vulkan/FramebufferManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/VideoBackends/Vulkan/FramebufferManager.cpp')
-rw-r--r--Source/Core/VideoBackends/Vulkan/FramebufferManager.cpp103
1 files changed, 0 insertions, 103 deletions
diff --git a/Source/Core/VideoBackends/Vulkan/FramebufferManager.cpp b/Source/Core/VideoBackends/Vulkan/FramebufferManager.cpp
index 53351e0325..305f0343f7 100644
--- a/Source/Core/VideoBackends/Vulkan/FramebufferManager.cpp
+++ b/Source/Core/VideoBackends/Vulkan/FramebufferManager.cpp
@@ -89,11 +89,6 @@ MultisamplingState FramebufferManager::GetEFBMultisamplingState() const
return ms;
}
-std::pair<u32, u32> FramebufferManager::GetTargetSize() const
-{
- return std::make_pair(GetEFBWidth(), GetEFBHeight());
-}
-
bool FramebufferManager::Initialize()
{
if (!CreateEFBRenderPass())
@@ -1382,102 +1377,4 @@ void FramebufferManager::DestroyPokeShaders()
}
}
-std::unique_ptr<XFBSourceBase> FramebufferManager::CreateXFBSource(unsigned int target_width,
- unsigned int target_height,
- unsigned int layers)
-{
- TextureConfig config;
- config.width = target_width;
- config.height = target_height;
- config.layers = layers;
- config.rendertarget = true;
- auto texture = TextureCache::GetInstance()->CreateTexture(config);
- if (!texture)
- {
- PanicAlert("Failed to create texture for XFB source");
- return nullptr;
- }
-
- return std::make_unique<XFBSource>(std::move(texture));
-}
-
-void FramebufferManager::CopyToRealXFB(u32 xfb_addr, u32 fb_stride, u32 fb_height,
- const EFBRectangle& source_rc, float gamma)
-{
- // Pending/batched EFB pokes should be included in the copied image.
- FlushEFBPokes();
-
- // Schedule early command-buffer execution.
- StateTracker::GetInstance()->EndRenderPass();
- StateTracker::GetInstance()->OnReadback();
-
- // GPU EFB textures -> Guest memory
- u8* xfb_ptr = Memory::GetPointer(xfb_addr);
- _assert_(xfb_ptr);
-
- // source_rc is in native coordinates, so scale it to the internal resolution.
- TargetRectangle scaled_rc = g_renderer->ConvertEFBRectangle(source_rc);
- VkRect2D scaled_rc_vk = {
- {scaled_rc.left, scaled_rc.top},
- {static_cast<u32>(scaled_rc.GetWidth()), static_cast<u32>(scaled_rc.GetHeight())}};
- Texture2D* src_texture = ResolveEFBColorTexture(scaled_rc_vk);
-
- // The destination stride can differ from the copy region width, in which case the pixels
- // outside the copy region should not be written to.
- TextureCache::GetInstance()->GetTextureConverter()->EncodeTextureToMemoryYUYV(
- xfb_ptr, static_cast<u32>(source_rc.GetWidth()), fb_stride, fb_height, src_texture,
- scaled_rc);
-
- // If we sourced directly from the EFB framebuffer, restore it to a color attachment.
- if (src_texture == m_efb_color_texture.get())
- {
- src_texture->TransitionToLayout(g_command_buffer_mgr->GetCurrentCommandBuffer(),
- VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL);
- }
-}
-
-XFBSource::XFBSource(std::unique_ptr<AbstractTexture> texture)
- : XFBSourceBase(), m_texture(std::move(texture))
-{
-}
-
-XFBSource::~XFBSource()
-{
-}
-
-VKTexture* XFBSource::GetTexture() const
-{
- return static_cast<VKTexture*>(m_texture.get());
-}
-
-void XFBSource::DecodeToTexture(u32 xfb_addr, u32 fb_width, u32 fb_height)
-{
- // Guest memory -> GPU EFB Textures
- const u8* src_ptr = Memory::GetPointer(xfb_addr);
- _assert_(src_ptr);
- TextureCache::GetInstance()->GetTextureConverter()->DecodeYUYVTextureFromMemory(
- static_cast<VKTexture*>(m_texture.get()), src_ptr, fb_width, fb_width * 2, fb_height);
-}
-
-void XFBSource::CopyEFB(float gamma)
-{
- // Pending/batched EFB pokes should be included in the copied image.
- FramebufferManager::GetInstance()->FlushEFBPokes();
-
- // Virtual XFB, copy EFB at native resolution to m_texture
- MathUtil::Rectangle<int> rect(0, 0, static_cast<int>(texWidth), static_cast<int>(texHeight));
- VkRect2D vk_rect = {{rect.left, rect.top},
- {static_cast<u32>(rect.GetWidth()), static_cast<u32>(rect.GetHeight())}};
-
- Texture2D* src_texture = FramebufferManager::GetInstance()->ResolveEFBColorTexture(vk_rect);
- static_cast<VKTexture*>(m_texture.get())->CopyRectangleFromTexture(src_texture, rect, rect);
-
- // If we sourced directly from the EFB framebuffer, restore it to a color attachment.
- if (src_texture == FramebufferManager::GetInstance()->GetEFBColorTexture())
- {
- src_texture->TransitionToLayout(g_command_buffer_mgr->GetCurrentCommandBuffer(),
- VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL);
- }
-}
-
} // namespace Vulkan