Browse files

MotoGP: Compat hack to disable framebuffer readbacks.

This is the only known game to copy its framebufer to RAM before display on every frame and we already have a
hack so we can display the high resolution framebuffer, but we still did the readback for no good reason.

This eliminates the readback.
  • Loading branch information...
hrydgard committed Nov 10, 2017
1 parent f014735 commit 05930ea32e6210a85a1d79acd918a926397b5d92
@@ -54,6 +54,7 @@ void Compatibility::CheckSettings(IniFile &iniFile, const std::string &gameID) {
CheckSetting(iniFile, gameID, "FakeMipmapChange", &flags_.FakeMipmapChange);
CheckSetting(iniFile, gameID, "RequireBufferedRendering", &flags_.RequireBufferedRendering);
CheckSetting(iniFile, gameID, "RequireBlockTransfer", &flags_.RequireBlockTransfer);
CheckSetting(iniFile, gameID, "DisableReadbacks", &flags_.DisableReadbacks);
void Compatibility::CheckSetting(IniFile &iniFile, const std::string &gameID, const char *option, bool *flag) {
@@ -54,6 +54,7 @@ struct CompatFlags {
bool FakeMipmapChange;
bool RequireBufferedRendering;
bool RequireBlockTransfer;
bool DisableReadbacks;
class IniFile;
@@ -75,4 +76,4 @@ class Compatibility {
void CheckSetting(IniFile &iniFile, const std::string &gameID, const char *option, bool *flag);
CompatFlags flags_;
@@ -1311,7 +1311,7 @@ bool FramebufferManagerCommon::NotifyFramebufferCopy(u32 src, u32 dst, int size,
if (srcH == 0 || srcY + srcH > srcBuffer->bufferHeight) {
WARN_LOG_REPORT_ONCE(btdcpyheight, G3D, "Memcpy fbo download %08x -> %08x skipped, %d+%d is taller than %d", src, dst, srcY, srcH, srcBuffer->bufferHeight);
} else if (g_Config.bBlockTransferGPU && !srcBuffer->memoryUpdated) {
} else if (g_Config.bBlockTransferGPU && !srcBuffer->memoryUpdated && !PSP_CoreParameter().compat.flags().DisableReadbacks) {
ReadFramebufferToMemory(srcBuffer, true, 0, srcY, srcBuffer->width, srcH);
srcBuffer->usageFlags = (srcBuffer->usageFlags | FB_USAGE_DOWNLOAD) & ~FB_USAGE_DOWNLOAD_CLEAR;
@@ -128,7 +128,7 @@ static VkBool32 VKAPI_CALL Vulkan_Dbg(VkDebugReportFlagsEXT msgFlags, VkDebugRep
return false;
if (msgCode == 64) // Another useless perf warning that will be seen less and less as we optimize - vkCmdClearAttachments() issued on command buffer object 0x00000195296C6D40 prior to any Draw Cmds. It is recommended you use RenderPass LOAD_OP_CLEAR on Attachments prior to any Draw.
return false;
#ifdef _WIN32
std::string msg = message.str();
@@ -131,6 +131,12 @@ UCKS45022 = true
ULJS19009 = true
NPJH50141 = true
# MotoGP copies the framebuffer to RAM every frame. We have a hack to display it directly,
# which means we don't also need a readback.
ULJS00078 = true
ULUS10153 = true
UCES00373 = true
# This replaced Crash Tag Team Racing hack to also fix Gundam games

0 comments on commit 05930ea

Please sign in to comment.