From dc03050730ff5ce41c2b20433c11771589b49f2e Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 7 Jul 2019 07:37:39 -0700 Subject: [PATCH] GPU: Download CLUTs when loading at 256 stride. Or otherwise when loading full rows. Should fix #8406. --- GPU/Common/FramebufferCommon.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/GPU/Common/FramebufferCommon.cpp b/GPU/Common/FramebufferCommon.cpp index 6417452c19..ddf3a61d08 100644 --- a/GPU/Common/FramebufferCommon.cpp +++ b/GPU/Common/FramebufferCommon.cpp @@ -2082,6 +2082,11 @@ void FramebufferManagerCommon::DownloadFramebufferForClut(u32 fb_address, u32 lo int w = std::min(pixels % vfb->fb_stride, (int)vfb->width); int h = std::min((pixels + vfb->fb_stride - 1) / vfb->fb_stride, (int)vfb->height); + if (w == 0 && h > 0) { + // Exactly aligned (means pixels == vfb->fb_stride, so modulus gave zero.) + w = std::min(vfb->fb_stride, (int)vfb->width); + } + // We might still have a pending draw to the fb in question, flush if so. FlushBeforeCopy();