From c0352eb19f461f5a6b4c72b2dfaff6bd733cffb6 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Sun, 11 Jul 2021 14:09:11 +1000 Subject: [PATCH] GPU/HW: Clear host display texture on interlace switch --- src/core/gpu_hw_d3d11.cpp | 2 ++ src/core/gpu_hw_opengl.cpp | 2 ++ src/core/gpu_hw_vulkan.cpp | 2 ++ 3 files changed, 6 insertions(+) diff --git a/src/core/gpu_hw_d3d11.cpp b/src/core/gpu_hw_d3d11.cpp index 0040b1677..ad97d7407 100644 --- a/src/core/gpu_hw_d3d11.cpp +++ b/src/core/gpu_hw_d3d11.cpp @@ -824,6 +824,8 @@ void GPU_HW_D3D11::ClearDisplay() { GPU_HW::ClearDisplay(); + m_host_display->ClearDisplayTexture(); + static constexpr std::array clear_color = {0.0f, 0.0f, 0.0f, 1.0f}; m_context->ClearRenderTargetView(m_display_texture.GetD3DRTV(), clear_color.data()); } diff --git a/src/core/gpu_hw_opengl.cpp b/src/core/gpu_hw_opengl.cpp index 94bd39582..dcd041898 100644 --- a/src/core/gpu_hw_opengl.cpp +++ b/src/core/gpu_hw_opengl.cpp @@ -837,6 +837,8 @@ void GPU_HW_OpenGL::ClearDisplay() { GPU_HW::ClearDisplay(); + m_host_display->ClearDisplayTexture(); + m_display_texture.BindFramebuffer(GL_DRAW_FRAMEBUFFER); glDisable(GL_SCISSOR_TEST); glClearColor(0.0f, 0.0f, 0.0f, 1.0f); diff --git a/src/core/gpu_hw_vulkan.cpp b/src/core/gpu_hw_vulkan.cpp index a13544d8c..6d9dd38c0 100644 --- a/src/core/gpu_hw_vulkan.cpp +++ b/src/core/gpu_hw_vulkan.cpp @@ -1298,6 +1298,8 @@ void GPU_HW_Vulkan::ClearDisplay() GPU_HW::ClearDisplay(); EndRenderPass(); + m_host_display->ClearDisplayTexture(); + VkCommandBuffer cmdbuf = g_vulkan_context->GetCurrentCommandBuffer(); m_display_texture.TransitionToLayout(cmdbuf, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL);