Skip to content

Commit

Permalink
Revise comments according to feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Aug 17, 2022
1 parent a8b1d11 commit 078fc88
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
5 changes: 2 additions & 3 deletions GPU/Common/FramebufferManagerCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,8 @@ VirtualFramebuffer *FramebufferManagerCommon::GetVFBAt(u32 addr) const {
for (size_t i = 0; i < vfbs_.size(); ++i) {
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) {
// Could check w too but whatever (actually, might very well make sense to do so, depending on context).
if (!match || v->last_frame_render > match->last_frame_render) {
match = v;
}
}
Expand Down
9 changes: 6 additions & 3 deletions GPU/Common/FramebufferManagerCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ struct VirtualFramebuffer {
u16 renderWidth;
u16 renderHeight;

// Attempt to keep track of a bounding rectangle of what's been actually drawn. However, right now these are not
// used in a very detailed way (they're only ever 0 or equal to width/height)
// Attempt to keep track of a bounding rectangle of what's been actually drawn. Coarse, but might be smaller
// than width/height if framebuffer has been enlarged. In PSP pixels.
u16 drawnWidth;
u16 drawnHeight;

Expand All @@ -110,7 +110,10 @@ struct VirtualFramebuffer {
u16 usageFlags;

// These are used to track state to try to avoid buffer size shifting back and forth.
// Though that shouldn't really happen, should it, since we always grow, don't shrink?
// You might think that doesn't happen since we mostly grow framebuffers, but we do resize down,
// if the size has shrunk for a while and the framebuffer is also larger than the stride.
// At this point, the "safe" size is probably a lie, and we have had various issues with readbacks, so this resizes down to avoid them.
// An example would be a game that always uses the address 0x00154000 for temp buffers, and uses it for a full-screen effect for 3 frames, then goes back to using it for character shadows or something much smaller.
u16 newWidth;
u16 newHeight;

Expand Down

0 comments on commit 078fc88

Please sign in to comment.