Better framebuffer checks, remove all ways that framebuffer formats can change.

This commit is contained in:
Henrik Rydgård 2022-08-29 10:14:29 +02:00
parent 34ed960a72
commit cd37bffdaa
3 changed files with 103 additions and 50 deletions

View file

@ -2936,17 +2936,18 @@ void GPUCommon::InvalidateCache(u32 addr, int size, GPUInvalidationType type) {
if (type != GPU_INVALIDATE_ALL && framebufferManager_->MayIntersectFramebuffer(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) {
framebufferManager_->UpdateFromMemory(addr, size, type == GPU_INVALIDATE_SAFE);
}
}
}
void GPUCommon::NotifyVideoUpload(u32 addr, int size, int width, int format) {
void GPUCommon::NotifyVideoUpload(u32 addr, int size, int frameWidth, int format) {
if (Memory::IsVRAMAddress(addr)) {
framebufferManager_->NotifyVideoUpload(addr, size, width, (GEBufferFormat)format);
framebufferManager_->NotifyVideoUpload(addr, size, frameWidth, (GEBufferFormat)format);
}
textureCache_->NotifyVideoUpload(addr, size, width, (GEBufferFormat)format);
textureCache_->NotifyVideoUpload(addr, size, frameWidth, (GEBufferFormat)format);
InvalidateCache(addr, size, GPU_INVALIDATE_SAFE);
}