From a0a24c77524b55f5fa01325bf099afd2c59ecb1d Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Tue, 12 Jan 2021 02:16:04 +1000 Subject: [PATCH] GPU/Vulkan: Only update sample texture when render area dirty Fixes crash when using Show VRAM in some games with Vulkan. --- src/core/gpu_hw_vulkan.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/core/gpu_hw_vulkan.cpp b/src/core/gpu_hw_vulkan.cpp index 10f8d4597..e4ca7baca 100644 --- a/src/core/gpu_hw_vulkan.cpp +++ b/src/core/gpu_hw_vulkan.cpp @@ -1214,7 +1214,13 @@ void GPU_HW_Vulkan::UpdateDisplay() { if (IsUsingMultisampling()) { - UpdateVRAMReadTexture(); + if (m_vram_dirty_rect.Intersects( + Common::Rectangle::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_vram_read_texture.GetWidth(), m_vram_read_texture.GetHeight(), 0, 0, m_vram_read_texture.GetWidth(), m_vram_read_texture.GetHeight());