Skip to content

Commit

Permalink
Rename MayIntersectFramebuffer to MayInteresectFramebufferColor
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Dec 6, 2023
1 parent 88f2657 commit 8588b11
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
12 changes: 6 additions & 6 deletions GPU/Common/FramebufferManagerCommon.cpp
Expand Up @@ -511,8 +511,8 @@ VirtualFramebuffer *FramebufferManagerCommon::DoSetRenderFrameBuffer(Framebuffer
vfb->usageFlags = FB_USAGE_RENDER_COLOR;

u32 colorByteSize = vfb->BufferByteSize(RASTER_COLOR);
if (Memory::IsVRAMAddress(params.fb_address) && params.fb_address + colorByteSize > framebufRangeEnd_) {
framebufRangeEnd_ = params.fb_address + colorByteSize;
if (Memory::IsVRAMAddress(params.fb_address) && params.fb_address + colorByteSize > framebufColorRangeEnd_) {
framebufColorRangeEnd_ = params.fb_address + colorByteSize;
}

// This is where we actually create the framebuffer. The true is "force".
Expand Down Expand Up @@ -2348,8 +2348,8 @@ VirtualFramebuffer *FramebufferManagerCommon::CreateRAMFramebuffer(uint32_t fbAd
vfbs_.push_back(vfb);

u32 byteSize = vfb->BufferByteSize(channel);
if (fbAddress + byteSize > framebufRangeEnd_) {
framebufRangeEnd_ = fbAddress + byteSize;
if (fbAddress + byteSize > framebufColorRangeEnd_) {
framebufColorRangeEnd_ = fbAddress + byteSize;
}

return vfb;
Expand Down Expand Up @@ -2525,7 +2525,7 @@ bool FramebufferManagerCommon::NotifyBlockTransferBefore(u32 dstBasePtr, int dst
dstStride *= 2;
width *= 2;
}
} else if (!MayIntersectFramebuffer(srcBasePtr) && !MayIntersectFramebuffer(dstBasePtr)) {
} else if (!MayIntersectFramebufferColor(srcBasePtr) && !MayIntersectFramebufferColor(dstBasePtr)) {
return false;
}

Expand Down Expand Up @@ -2710,7 +2710,7 @@ void FramebufferManagerCommon::NotifyBlockTransferAfter(u32 dstBasePtr, int dstS
}
}

if (MayIntersectFramebuffer(srcBasePtr) || MayIntersectFramebuffer(dstBasePtr)) {
if (MayIntersectFramebufferColor(srcBasePtr) || MayIntersectFramebufferColor(dstBasePtr)) {
// TODO: Figure out how we can avoid repeating the search here.

BlockTransferRect dstRect{};
Expand Down
6 changes: 3 additions & 3 deletions GPU/Common/FramebufferManagerCommon.h
Expand Up @@ -382,13 +382,13 @@ class FramebufferManagerCommon {
return useBufferedRendering_;
}

bool MayIntersectFramebuffer(u32 start) const {
bool MayIntersectFramebufferColor(u32 start) const {
// Clear the cache/kernel bits.
start &= 0x3FFFFFFF;
if (Memory::IsVRAMAddress(start))
start &= 0x041FFFFF;
// Most games only have two framebuffers at the start.
if (start >= framebufRangeEnd_ || start < PSP_GetVidMemBase()) {
if (start >= framebufColorRangeEnd_ || start < PSP_GetVidMemBase()) {
return false;
}
return true;
Expand Down Expand Up @@ -572,7 +572,7 @@ class FramebufferManagerCommon {
Draw::Framebuffer *currentFramebufferCopy_ = nullptr;

// The range of PSP memory that may contain FBOs. So we can skip iterating.
u32 framebufRangeEnd_ = 0;
u32 framebufColorRangeEnd_ = 0;

bool useBufferedRendering_ = false;
bool postShaderIsUpscalingFilter_ = false;
Expand Down
2 changes: 1 addition & 1 deletion GPU/Common/StencilCommon.cpp
Expand Up @@ -166,7 +166,7 @@ bool FramebufferManagerCommon::PerformWriteStencilFromMemory(u32 addr, int size,
using namespace Draw;

addr &= 0x3FFFFFFF;
if (!MayIntersectFramebuffer(addr)) {
if (!MayIntersectFramebufferColor(addr)) {
return false;
}

Expand Down
6 changes: 3 additions & 3 deletions GPU/GPUCommon.cpp
Expand Up @@ -1853,7 +1853,7 @@ void GPUCommon::DoBlockTransfer(u32 skipDrawReason) {

bool GPUCommon::PerformMemoryCopy(u32 dest, u32 src, int size, GPUCopyFlag flags) {
// Track stray copies of a framebuffer in RAM. MotoGP does this.
if (framebufferManager_->MayIntersectFramebuffer(src) || framebufferManager_->MayIntersectFramebuffer(dest)) {
if (framebufferManager_->MayIntersectFramebufferColor(src) || framebufferManager_->MayIntersectFramebufferColor(dest)) {
if (!framebufferManager_->NotifyFramebufferCopy(src, dest, size, flags, gstate_c.skipDrawReason)) {
// We use matching values in PerformReadbackToMemory/PerformWriteColorFromMemory.
// Since they're identical we don't need to copy.
Expand Down Expand Up @@ -1881,7 +1881,7 @@ bool GPUCommon::PerformMemoryCopy(u32 dest, u32 src, int size, GPUCopyFlag flags

bool GPUCommon::PerformMemorySet(u32 dest, u8 v, int size) {
// This may indicate a memset, usually to 0, of a framebuffer.
if (framebufferManager_->MayIntersectFramebuffer(dest)) {
if (framebufferManager_->MayIntersectFramebufferColor(dest)) {
Memory::Memset(dest, v, size, "GPUMemset");
if (!framebufferManager_->NotifyFramebufferCopy(dest, dest, size, GPUCopyFlag::MEMSET, gstate_c.skipDrawReason)) {
InvalidateCache(dest, size, GPU_INVALIDATE_HINT);
Expand Down Expand Up @@ -1920,7 +1920,7 @@ void GPUCommon::PerformWriteFormattedFromMemory(u32 addr, int size, int frameWid
}

bool GPUCommon::PerformWriteStencilFromMemory(u32 dest, int size, WriteStencil flags) {
if (framebufferManager_->MayIntersectFramebuffer(dest)) {
if (framebufferManager_->MayIntersectFramebufferColor(dest)) {
framebufferManager_->PerformWriteStencilFromMemory(dest, size, flags);
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion GPU/GPUCommonHW.cpp
Expand Up @@ -773,7 +773,7 @@ void GPUCommonHW::InvalidateCache(u32 addr, int size, GPUInvalidationType type)
else
textureCache_->InvalidateAll(type);

if (type != GPU_INVALIDATE_ALL && framebufferManager_->MayIntersectFramebuffer(addr)) {
if (type != GPU_INVALIDATE_ALL && framebufferManager_->MayIntersectFramebufferColor(addr)) {
// Vempire invalidates (with writeback) after drawing, but before blitting.
// TODO: Investigate whether we can get this to work some other way.
if (type == GPU_INVALIDATE_SAFE) {
Expand Down

0 comments on commit 8588b11

Please sign in to comment.