diff --git a/src/core/gpu_commands.cpp b/src/core/gpu_commands.cpp index a57f6c421..cdcd5a4d5 100644 --- a/src/core/gpu_commands.cpp +++ b/src/core/gpu_commands.cpp @@ -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(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); } diff --git a/src/core/gpu_hw.cpp b/src/core/gpu_hw.cpp index 64c4a8d53..d4b2054ba 100644 --- a/src/core/gpu_hw.cpp +++ b/src/core/gpu_hw.cpp @@ -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))