Skip downloads of cleared VRAM.

If we've just cleared VRAM, make sure we don't also download that clear.
This commit is contained in:
Unknown W. Brackets 2017-04-09 15:19:06 -07:00
parent fe07b14a22
commit 4a8c661c00

View File

@ -772,9 +772,9 @@ void FramebufferManagerCommon::DrawFramebufferToOutput(const u8 *srcPixels, GEBu
}
void FramebufferManagerCommon::DownloadFramebufferOnSwitch(VirtualFramebuffer *vfb) {
if (vfb && vfb->safeWidth > 0 && vfb->safeHeight > 0 && !vfb->firstFrameSaved) {
if (vfb && vfb->safeWidth > 0 && vfb->safeHeight > 0 && !vfb->firstFrameSaved && !vfb->memoryUpdated) {
// Some games will draw to some memory once, and use it as a render-to-texture later.
// To support this, we save the first frame to memory when we have a save w/h.
// To support this, we save the first frame to memory when we have a safe w/h.
// Saving each frame would be slow.
if (!g_Config.bDisableSlowFramebufEffects) {
ReadFramebufferToMemory(vfb, true, 0, 0, vfb->safeWidth, vfb->safeHeight);
@ -1471,6 +1471,7 @@ void FramebufferManagerCommon::ApplyClearToMemory(int x1, int y1, int x2, int y2
// The current content is in memory now, so update the flag.
if (x1 == 0 && y1 == 0 && x2 >= currentRenderVfb_->width && y2 >= currentRenderVfb_->height) {
currentRenderVfb_->usageFlags |= FB_USAGE_DOWNLOAD_CLEAR;
currentRenderVfb_->memoryUpdated = true;
}
}
}