Merge pull request #8182 from Techjar/imgui-reset-scissor

VideoCommon/RenderBase: Reset scissor rectangle after ImGui rendering
This commit is contained in:
Connor McLaughlin 2019-06-15 21:29:07 +10:00 committed by GitHub
commit 9e1c38b6e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -1148,6 +1148,15 @@ void Renderer::DrawImGui()
base_index += cmd.ElemCount; base_index += cmd.ElemCount;
} }
} }
// Some capture software (such as OBS) hooks SwapBuffers and uses glBlitFramebuffer to copy our
// back buffer just before swap. Because glBlitFramebuffer honors the scissor test, the capture
// itself will be clipped to whatever bounds were last set by ImGui, resulting in a rather useless
// capture whenever any ImGui windows are open. We'll reset the scissor rectangle to the entire
// viewport here to avoid this problem.
SetScissorRect(ConvertFramebufferRectangle(
MathUtil::Rectangle<int>(0, 0, m_backbuffer_width, m_backbuffer_height),
m_current_framebuffer));
} }
std::unique_lock<std::mutex> Renderer::GetImGuiLock() std::unique_lock<std::mutex> Renderer::GetImGuiLock()