Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Framebuffer-bind sequence numbers #15853

Merged
merged 4 commits into from
Aug 17, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Comment updates
  • Loading branch information
hrydgard committed Aug 17, 2022
commit 19367dd890a95dd3e85c8dd7c97657c922857a85
2 changes: 2 additions & 0 deletions GPU/Common/FramebufferManagerCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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?
hrydgard marked this conversation as resolved.
Show resolved Hide resolved
if (match == nullptr || match->last_frame_render < v->last_frame_render) {
match = v;
}
Expand Down Expand Up @@ -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);
}

Expand Down
4 changes: 3 additions & 1 deletion GPU/Common/FramebufferManagerCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,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_);
}
Expand Down
1 change: 1 addition & 0 deletions GPU/Directx9/FramebufferManagerDX9.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@
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);
}

Expand Down