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

View file

@ -1213,8 +1213,14 @@ void GPU_HW_Vulkan::UpdateDisplay()
if (g_settings.debugging.show_vram) if (g_settings.debugging.show_vram)
{ {
if (IsUsingMultisampling()) if (IsUsingMultisampling())
{
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(); 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());