Merge pull request #4321 from unknownbrackets/fbo-minor

Fix some video -> framebuffer issues
This commit is contained in:
Henrik Rydgård 2013-10-26 08:16:34 -07:00
commit 1fa5718e4a
3 changed files with 6 additions and 4 deletions

View File

@ -1395,11 +1395,11 @@ void FramebufferManager::DestroyAllFBOs() {
vfbs_.clear();
}
void FramebufferManager::UpdateFromMemory(u32 addr, int size) {
void FramebufferManager::UpdateFromMemory(u32 addr, int size, bool safe) {
addr &= ~0x40000000;
// TODO: Could go through all FBOs, but probably not important?
// TODO: Could also check for inner changes, but video is most important.
if (addr == DisplayFramebufAddr() || addr == PrevDisplayFramebufAddr()) {
if (addr == DisplayFramebufAddr() || addr == PrevDisplayFramebufAddr() || safe) {
// TODO: Deleting the FBO is a heavy hammer solution, so let's only do it if it'd help.
if (!Memory::IsValidAddress(displayFramebufPtr_))
return;
@ -1416,6 +1416,8 @@ void FramebufferManager::UpdateFromMemory(u32 addr, int size) {
// TODO: This without the fbo_unbind() above would be better than destroying the FBO.
// However, it doesn't seem to work for Star Ocean, at least
if (useBufferedRendering_ && vfb->fbo) {
DisableState();
glstate.viewport.set(0, 0, vfb->renderWidth, vfb->renderHeight);
fbo_bind_as_render_target(vfb->fbo);
needUnbind = true;
DrawPixels(Memory::GetPointer(addr | 0x04000000), vfb->format, vfb->fb_stride);

View File

@ -128,7 +128,7 @@ public:
void DeviceLost();
void CopyDisplayToOutput();
void SetRenderFrameBuffer(); // Uses parameters computed from gstate
void UpdateFromMemory(u32 addr, int size);
void UpdateFromMemory(u32 addr, int size, bool safe);
void SetLineWidth();
#ifdef USING_GLES2

View File

@ -1536,7 +1536,7 @@ void GLES_GPU::InvalidateCacheInternal(u32 addr, int size, GPUInvalidationType t
textureCache_.InvalidateAll(type);
if (type != GPU_INVALIDATE_ALL)
framebufferManager_.UpdateFromMemory(addr, size);
framebufferManager_.UpdateFromMemory(addr, size, type == GPU_INVALIDATE_SAFE);
}
void GLES_GPU::UpdateMemory(u32 dest, u32 src, int size) {