From a4599a1adda5c1d445b70d0dfe70b50fe3888662 Mon Sep 17 00:00:00 2001 From: iwubcode Date: Thu, 13 Nov 2025 21:44:29 -0600 Subject: VideoCommon: avoid assuming global state exists for 'EndUtilityDrawing', use last stored viewport/scissor rect instead --- Source/Core/VideoCommon/BPFunctions.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Source/Core/VideoCommon/BPFunctions.cpp') diff --git a/Source/Core/VideoCommon/BPFunctions.cpp b/Source/Core/VideoCommon/BPFunctions.cpp index 660d85c598..134a14f8d4 100644 --- a/Source/Core/VideoCommon/BPFunctions.cpp +++ b/Source/Core/VideoCommon/BPFunctions.cpp @@ -265,6 +265,14 @@ void SetScissorAndViewport(FramebufferManager* frame_buffer_manager, ScissorPos y = static_cast(g_gfx->GetCurrentFramebuffer()->GetHeight()) - y - height; g_gfx->SetViewport(x, y, width, height, near_depth, far_depth); + + g_gfx->StoreViewportAndScissor(AbstractGfx::ViewportAndScissor{.scissor_rect = converted_rc, + .viewport_x = x, + .viewport_y = y, + .viewport_width = width, + .viewport_height = height, + .viewport_near_depth = near_depth, + .viewport_far_depth = far_depth}); } void SetDepthMode() -- cgit v1.2.3