GPU/HW: Write through VRAM transfers

Reduces the chances of rendering nothing after device loss.
This commit is contained in:
Stenzek 2024-10-14 18:20:47 +10:00
parent afd36560c1
commit 219e890da5
No known key found for this signature in database
1 changed files with 5 additions and 6 deletions

View File

@ -3296,12 +3296,7 @@ void GPU_HW::UpdateVRAM(u32 x, u32 y, u32 width, u32 height, const void* data, b
DebugAssert(bounds.right <= static_cast<s32>(VRAM_WIDTH) && bounds.bottom <= static_cast<s32>(VRAM_HEIGHT)); DebugAssert(bounds.right <= static_cast<s32>(VRAM_WIDTH) && bounds.bottom <= static_cast<s32>(VRAM_HEIGHT));
AddWrittenRectangle(bounds); AddWrittenRectangle(bounds);
// We want to dump *before* the write goes through, otherwise we dump bad data. if (m_sw_renderer)
if (m_use_texture_cache)
{
GPUTextureCache::WriteVRAM(x, y, width, height, data, set_mask, check_mask, bounds);
}
else if (m_sw_renderer)
{ {
const u32 num_words = width * height; const u32 num_words = width * height;
GPUBackendUpdateVRAMCommand* cmd = m_sw_renderer->NewUpdateVRAMCommand(num_words); GPUBackendUpdateVRAMCommand* cmd = m_sw_renderer->NewUpdateVRAMCommand(num_words);
@ -3315,6 +3310,10 @@ void GPU_HW::UpdateVRAM(u32 x, u32 y, u32 width, u32 height, const void* data, b
std::memcpy(cmd->data, data, sizeof(u16) * num_words); std::memcpy(cmd->data, data, sizeof(u16) * num_words);
m_sw_renderer->PushCommand(cmd); m_sw_renderer->PushCommand(cmd);
} }
else
{
GPUTextureCache::WriteVRAM(x, y, width, height, data, set_mask, check_mask, bounds);
}
if (check_mask) if (check_mask)
{ {