GPU: Move background dumping to HW+GPU thread

And only dump when the mask bit check is not enabled.

The replacements are gated by the mask bit check anyway, so there's
no point dumping anything that can't be replaced.
This commit is contained in:
Stenzek 2024-12-25 15:40:52 +10:00
parent 6f3e9913f5
commit b03127b206
No known key found for this signature in database
2 changed files with 4 additions and 7 deletions

View File

@ -5,7 +5,6 @@
#include "gpu.h"
#include "gpu_backend.h"
#include "gpu_dump.h"
#include "gpu_hw_texture_cache.h"
#include "gpu_thread_commands.h"
#include "interrupt_controller.h"
#include "system.h"
@ -1048,12 +1047,6 @@ void GPU::FinishVRAMWrite()
m_vram_transfer.height, sizeof(u16) * m_vram_transfer.width, m_blit_buffer.data(), true);
}
if (GPUTextureCache::ShouldDumpVRAMWrite(m_vram_transfer.width, m_vram_transfer.height))
{
GPUTextureCache::DumpVRAMWrite(m_vram_transfer.width, m_vram_transfer.height,
reinterpret_cast<const u16*>(m_blit_buffer.data()));
}
UpdateVRAM(m_vram_transfer.x, m_vram_transfer.y, m_vram_transfer.width, m_vram_transfer.height,
m_blit_buffer.data(), m_GPUSTAT.set_mask_while_drawing, m_GPUSTAT.check_mask_before_draw);
}

View File

@ -3243,6 +3243,10 @@ void GPU_HW::UpdateVRAM(u32 x, u32 y, u32 width, u32 height, const void* data, b
}
else
{
// no point dumping things we can't replace, so put it after the mask check
if (GPUTextureCache::ShouldDumpVRAMWrite(width, height))
GPUTextureCache::DumpVRAMWrite(width, height, data);
GPUTexture* rtex = GPUTextureCache::GetVRAMReplacement(width, height, data);
if (rtex && BlitVRAMReplacementTexture(rtex, x * m_resolution_scale, y * m_resolution_scale,
width * m_resolution_scale, height * m_resolution_scale))