summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/Vulkan/FramebufferManager.cpp
diff options
context:
space:
mode:
authorStenzek <stenzek@users.noreply.github.com>2016-11-20 12:34:11 +1000
committerGitHub <noreply@github.com>2016-11-20 12:34:11 +1000
commit3d21169dfc401e2ce92da9f32ce4740e82838c98 (patch)
treeb312d81e3443338ca82a9f527253c5e57fb549c8 /Source/Core/VideoBackends/Vulkan/FramebufferManager.cpp
parent2a5d22b3a7c9ba4a67107cbdbe3cbea87c6a2af2 (diff)
parentd6d33411834df82dea8e7c250925ccfe595e0cc2 (diff)
Merge pull request #4458 from stenzek/strided-xfb
D3D/Vulkan: Handle strided XFB copies
Diffstat (limited to 'Source/Core/VideoBackends/Vulkan/FramebufferManager.cpp')
-rw-r--r--Source/Core/VideoBackends/Vulkan/FramebufferManager.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/Source/Core/VideoBackends/Vulkan/FramebufferManager.cpp b/Source/Core/VideoBackends/Vulkan/FramebufferManager.cpp
index 17dc9253cd..f01f8ac25b 100644
--- a/Source/Core/VideoBackends/Vulkan/FramebufferManager.cpp
+++ b/Source/Core/VideoBackends/Vulkan/FramebufferManager.cpp
@@ -1415,9 +1415,11 @@ void FramebufferManager::CopyToRealXFB(u32 xfb_addr, u32 fb_stride, u32 fb_heigh
{static_cast<u32>(scaled_rc.GetWidth()), static_cast<u32>(scaled_rc.GetHeight())}};
Texture2D* src_texture = ResolveEFBColorTexture(scaled_rc_vk);
- // 2 bytes per pixel, so divide fb_stride by 2 to get the width.
- TextureCache::GetInstance()->EncodeYUYVTextureToMemory(xfb_ptr, fb_stride / 2, fb_stride,
- fb_height, src_texture, scaled_rc);
+ // 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()->EncodeYUYVTextureToMemory(
+ 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())