Fix infinite recursion in framebuf create upload.

Needs to be done *after* currentRenderVfb_ is set.

Fixes #6872.
This commit is contained in:
Unknown W. Brackets 2014-09-10 23:58:07 -07:00
parent 3571ba6328
commit f7b669a740
3 changed files with 8 additions and 19 deletions

View file

@ -310,14 +310,6 @@ void FramebufferManagerCommon::DoSetRenderFrameBuffer() {
ResizeFramebufFBO(vfb, drawing_width, drawing_height, true);
NotifyRenderFramebufferCreated(vfb);
if (useBufferedRendering_ && !updateVRAM_ && !g_Config.bDisableSlowFramebufEffects) {
u32 byteSize = FramebufferByteSize(vfb);
u32 fb_address_mem = (vfb->fb_address & 0x3FFFFFFF) | 0x04000000;
gpu->PerformMemoryUpload(fb_address_mem, byteSize);
NotifyStencilUpload(fb_address_mem, byteSize, true);
// TODO: Is it worth trying to upload the depth buffer?
}
INFO_LOG(SCEGE, "Creating FBO for %08x : %i x %i x %i", vfb->fb_address, vfb->width, vfb->height, vfb->format);
vfb->last_frame_render = gpuStats.numFlips;
@ -327,6 +319,12 @@ void FramebufferManagerCommon::DoSetRenderFrameBuffer() {
vfbs_.push_back(vfb);
currentRenderVfb_ = vfb;
if (useBufferedRendering_ && !updateVRAM_ && !g_Config.bDisableSlowFramebufEffects) {
gpu->PerformMemoryUpload(fb_address_mem, byteSize);
NotifyStencilUpload(fb_address_mem, byteSize, true);
// TODO: Is it worth trying to upload the depth buffer?
}
// Let's check for depth buffer overlap. Might be interesting.
bool sharingReported = false;
bool writingDepth = true;

View file

@ -393,15 +393,6 @@ namespace DX9 {
ClearBuffer();
// TODO (in Common)
//if (useBufferedRendering_ && !updateVRAM_ && !g_Config.bDisableSlowFramebufEffects) {
// u32 byteSize = FramebufferByteSize(vfb);
// u32 fb_address_mem = (vfb->fb_address & 0x3FFFFFFF) | 0x04000000;
// gpu->PerformMemoryUpload(fb_address_mem, byteSize);
// NotifyStencilUpload(fb_address_mem, byteSize, true);
// // TODO: Is it worth trying to upload the depth buffer?
//}
// ugly...
if (gstate_c.curRTWidth != vfb->width || gstate_c.curRTHeight != vfb->height) {
shaderManager_->DirtyUniform(DIRTY_PROJTHROUGHMATRIX);

View file

@ -2104,7 +2104,7 @@ bool GLES_GPU::PerformMemoryDownload(u32 dest, int size) {
// Cheat a bit to force a download of the framebuffer.
// VRAM + 0x00400000 is simply a VRAM mirror.
if (Memory::IsVRAMAddress(dest)) {
return gpu->PerformMemoryCopy(dest ^ 0x00400000, dest, size);
return PerformMemoryCopy(dest ^ 0x00400000, dest, size);
}
return false;
}
@ -2113,7 +2113,7 @@ bool GLES_GPU::PerformMemoryUpload(u32 dest, int size) {
// Cheat a bit to force an upload of the framebuffer.
// VRAM + 0x00400000 is simply a VRAM mirror.
if (Memory::IsVRAMAddress(dest)) {
return gpu->PerformMemoryCopy(dest, dest ^ 0x00400000, size);
return PerformMemoryCopy(dest, dest ^ 0x00400000, size);
}
return false;
}