Clear currentRenderVfb_ when fbo_unbinding.

At least, not doing this caused glitches somewhere else, seems right.
This commit is contained in:
Unknown W. Brackets 2013-06-09 02:11:16 -07:00
parent f8d6bda678
commit d8618e5028

View File

@ -501,6 +501,7 @@ void FramebufferManager::SetRenderFrameBuffer() {
void FramebufferManager::CopyDisplayToOutput() { void FramebufferManager::CopyDisplayToOutput() {
fbo_unbind(); fbo_unbind();
currentRenderVfb_ = 0;
VirtualFramebuffer *vfb = GetDisplayFBO(); VirtualFramebuffer *vfb = GetDisplayFBO();
if (!vfb) { if (!vfb) {
@ -532,8 +533,6 @@ void FramebufferManager::CopyDisplayToOutput() {
} }
displayFramebuf_ = vfb; displayFramebuf_ = vfb;
currentRenderVfb_ = 0;
if (vfb->fbo) { if (vfb->fbo) {
glstate.viewport.set(0, 0, PSP_CoreParameter().pixelWidth, PSP_CoreParameter().pixelHeight); glstate.viewport.set(0, 0, PSP_CoreParameter().pixelWidth, PSP_CoreParameter().pixelHeight);
DEBUG_LOG(HLE, "Displaying FBO %08x", vfb->fb_address); DEBUG_LOG(HLE, "Displaying FBO %08x", vfb->fb_address);
@ -622,6 +621,8 @@ std::vector<FramebufferInfo> FramebufferManager::GetFramebufferList() {
void FramebufferManager::DecimateFBOs() { void FramebufferManager::DecimateFBOs() {
fbo_unbind(); fbo_unbind();
currentRenderVfb_ = 0;
for (auto iter = vfbs_.begin(); iter != vfbs_.end();) { for (auto iter = vfbs_.begin(); iter != vfbs_.end();) {
VirtualFramebuffer *vfb = *iter; VirtualFramebuffer *vfb = *iter;
if (vfb == displayFramebuf_ || vfb == prevDisplayFramebuf_ || vfb == prevPrevDisplayFramebuf_) { if (vfb == displayFramebuf_ || vfb == prevDisplayFramebuf_ || vfb == prevPrevDisplayFramebuf_) {
@ -646,6 +647,8 @@ void FramebufferManager::DecimateFBOs() {
void FramebufferManager::DestroyAllFBOs() { void FramebufferManager::DestroyAllFBOs() {
fbo_unbind(); fbo_unbind();
currentRenderVfb_ = 0;
for (auto iter = vfbs_.begin(); iter != vfbs_.end(); ++iter) { for (auto iter = vfbs_.begin(); iter != vfbs_.end(); ++iter) {
VirtualFramebuffer *vfb = *iter; VirtualFramebuffer *vfb = *iter;
textureCache_->NotifyFramebufferDestroyed(vfb->fb_address, vfb); textureCache_->NotifyFramebufferDestroyed(vfb->fb_address, vfb);
@ -670,6 +673,8 @@ void FramebufferManager::UpdateFromMemory(u32 addr, int size) {
return; return;
fbo_unbind(); fbo_unbind();
currentRenderVfb_ = 0;
for (auto iter = vfbs_.begin(); iter != vfbs_.end(); ) { for (auto iter = vfbs_.begin(); iter != vfbs_.end(); ) {
VirtualFramebuffer *vfb = *iter; VirtualFramebuffer *vfb = *iter;
if (MaskedEqual(vfb->fb_address, addr)) { if (MaskedEqual(vfb->fb_address, addr)) {