GPU/Vulkan: Only update sample texture when render area dirty

Fixes crash when using Show VRAM in some games with Vulkan.
This commit is contained in:
Connor McLaughlin 2021-01-12 02:16:04 +10:00
parent 16ad54143b
commit a0a24c7752
1 changed files with 7 additions and 1 deletions

View File

@ -1214,7 +1214,13 @@ void GPU_HW_Vulkan::UpdateDisplay()
{ {
if (IsUsingMultisampling()) if (IsUsingMultisampling())
{ {
UpdateVRAMReadTexture(); if (m_vram_dirty_rect.Intersects(
Common::Rectangle<u32>::FromExtents(m_crtc_state.display_vram_left, m_crtc_state.display_vram_top,
m_crtc_state.display_vram_width, m_crtc_state.display_vram_height)))
{
UpdateVRAMReadTexture();
}
m_host_display->SetDisplayTexture(&m_vram_read_texture, HostDisplayPixelFormat::RGBA8, m_host_display->SetDisplayTexture(&m_vram_read_texture, HostDisplayPixelFormat::RGBA8,
m_vram_read_texture.GetWidth(), m_vram_read_texture.GetHeight(), 0, 0, m_vram_read_texture.GetWidth(), m_vram_read_texture.GetHeight(), 0, 0,
m_vram_read_texture.GetWidth(), m_vram_read_texture.GetHeight()); m_vram_read_texture.GetWidth(), m_vram_read_texture.GetHeight());