GPUCommon::PerformMemoryCopy: Add a debug assert

This commit is contained in:
Henrik Rydgård 2024-10-25 21:13:45 +02:00
parent 7e6ef060c6
commit 8991329de4

View File

@ -1867,6 +1867,18 @@ void GPUCommon::DoBlockTransfer(u32 skipDrawReason) {
}
bool GPUCommon::PerformMemoryCopy(u32 dest, u32 src, int size, GPUCopyFlag flags) {
/*
// TODO: Should add this. But let's do it after the 1.18 release.
if (dest == 0 || src == 0) {
_dbg_assert_msg_(false, "Bad PerformMemoryCopy: %08x -> %08x, size %d (flag: %d)", src, dest, size, (int)flags);
return false;
}
*/
if (size == 0) {
_dbg_assert_msg_(false, "Zero-sized PerformMemoryCopy: %08x -> %08x, size %d (flag: %d)", src, dest, size, (int)flags);
// Let's not ignore this yet but if we hit this, we should investigate.
}
// Track stray copies of a framebuffer in RAM. MotoGP does this.
if (framebufferManager_->MayIntersectFramebufferColor(src) || framebufferManager_->MayIntersectFramebufferColor(dest)) {
if (!framebufferManager_->NotifyFramebufferCopy(src, dest, size, flags, gstate_c.skipDrawReason)) {