diff --git a/GPU/Common/FramebufferManagerCommon.cpp b/GPU/Common/FramebufferManagerCommon.cpp index 1b6a1b93e76b..fa2594d00be9 100644 --- a/GPU/Common/FramebufferManagerCommon.cpp +++ b/GPU/Common/FramebufferManagerCommon.cpp @@ -121,6 +121,7 @@ VirtualFramebuffer *FramebufferManagerCommon::GetVFBAt(u32 addr) const { VirtualFramebuffer *v = vfbs_[i]; if (v->fb_address == addr) { // Could check w too but whatever + // NOTE: This gets the OLDEST image at the address - is that good? if (match == nullptr || match->last_frame_render < v->last_frame_render) { match = v; } @@ -2083,6 +2084,7 @@ bool FramebufferManagerCommon::GetFramebuffer(u32 fb_address, int fb_stride, GEB bool FramebufferManagerCommon::GetDepthbuffer(u32 fb_address, int fb_stride, u32 z_address, int z_stride, GPUDebugBuffer &buffer) { VirtualFramebuffer *vfb = currentRenderVfb_; if (!vfb) { + // TODO: This is flawed, as it looks for color buffers at the address, not depth. vfb = GetVFBAt(fb_address); } diff --git a/GPU/Common/FramebufferManagerCommon.h b/GPU/Common/FramebufferManagerCommon.h index e081c3c75fdd..6e8e414deb59 100644 --- a/GPU/Common/FramebufferManagerCommon.h +++ b/GPU/Common/FramebufferManagerCommon.h @@ -333,8 +333,10 @@ class FramebufferManagerCommon { VirtualFramebuffer *GetCurrentRenderVFB() const { return currentRenderVfb_; } - // TODO: Break out into some form of FBO manager + + // This only checks for the color channel. VirtualFramebuffer *GetVFBAt(u32 addr) const; + VirtualFramebuffer *GetDisplayVFB() const { return GetVFBAt(displayFramebufPtr_); } diff --git a/GPU/Directx9/FramebufferManagerDX9.cpp b/GPU/Directx9/FramebufferManagerDX9.cpp index dab35117dc1a..6ef34d7695df 100644 --- a/GPU/Directx9/FramebufferManagerDX9.cpp +++ b/GPU/Directx9/FramebufferManagerDX9.cpp @@ -330,6 +330,7 @@ namespace DX9 { bool FramebufferManagerDX9::GetDepthbuffer(u32 fb_address, int fb_stride, u32 z_address, int z_stride, GPUDebugBuffer &buffer) { VirtualFramebuffer *vfb = currentRenderVfb_; if (!vfb) { + // TODO: This is flawed, as it looks for color buffers at the address, not depth. vfb = GetVFBAt(fb_address); }