diff --git a/GPU/Common/FramebufferCommon.h b/GPU/Common/FramebufferCommon.h index a6e055d29d..a494d7450d 100644 --- a/GPU/Common/FramebufferCommon.h +++ b/GPU/Common/FramebufferCommon.h @@ -110,6 +110,7 @@ public: } DoSetRenderFrameBuffer(); } + virtual void RebindFramebuffer() = 0; size_t NumVFBs() const { return vfbs_.size(); } diff --git a/GPU/Directx9/FramebufferDX9.cpp b/GPU/Directx9/FramebufferDX9.cpp index 5245c40231..f230016048 100644 --- a/GPU/Directx9/FramebufferDX9.cpp +++ b/GPU/Directx9/FramebufferDX9.cpp @@ -331,6 +331,14 @@ namespace DX9 { delete v; } + void FramebufferManagerDX9::RebindFramebuffer() { + if (currentRenderVfb_ && currentRenderVfb_->fbo) { + fbo_bind_as_render_target(currentRenderVfb_->fbo); + } else { + fbo_unbind(); + } + } + void FramebufferManagerDX9::ResizeFramebufFBO(VirtualFramebuffer *vfb, u16 w, u16 h, bool force) { float renderWidthFactor = (float)vfb->renderWidth / (float)vfb->bufferWidth; float renderHeightFactor = (float)vfb->renderHeight / (float)vfb->bufferHeight; @@ -750,6 +758,7 @@ namespace DX9 { } #endif #endif + RebindFramebuffer(); } } @@ -1006,9 +1015,7 @@ namespace DX9 { } } - // TODO: RebindFramebuffer(); - fbo_unbind(); - currentRenderVfb_ = 0; + RebindFramebuffer(); } } diff --git a/GPU/Directx9/FramebufferDX9.h b/GPU/Directx9/FramebufferDX9.h index cdc7227be3..0991871006 100644 --- a/GPU/Directx9/FramebufferDX9.h +++ b/GPU/Directx9/FramebufferDX9.h @@ -86,6 +86,8 @@ public: bool GetCurrentDepthbuffer(GPUDebugBuffer &buffer); bool GetCurrentStencilbuffer(GPUDebugBuffer &buffer); + virtual void RebindFramebuffer() override; + protected: virtual void DisableState() override; virtual void ClearBuffer() override; diff --git a/GPU/GLES/Framebuffer.h b/GPU/GLES/Framebuffer.h index a4432952b2..16bba3c6db 100644 --- a/GPU/GLES/Framebuffer.h +++ b/GPU/GLES/Framebuffer.h @@ -119,7 +119,7 @@ public: bool GetCurrentDepthbuffer(GPUDebugBuffer &buffer); bool GetCurrentStencilbuffer(GPUDebugBuffer &buffer); - void RebindFramebuffer(); + virtual void RebindFramebuffer() override; FBO *GetTempFBO(u16 w, u16 h, FBOColorDepth depth = FBO_8888);