From 41dd2d5cb4a2648f667365a7984a520959e644a6 Mon Sep 17 00:00:00 2001 From: mchughalex <25671999+mchughalex@users.noreply.github.com> Date: Tue, 21 Jul 2026 13:24:29 +0100 Subject: [PATCH] d3d12: batch submissions to frame end while native output suppresses emulated draws --- src/graphics/d3d12/command_processor.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/graphics/d3d12/command_processor.cpp b/src/graphics/d3d12/command_processor.cpp index df5d087..1f4f04c 100644 --- a/src/graphics/d3d12/command_processor.cpp +++ b/src/graphics/d3d12/command_processor.cpp @@ -2497,7 +2497,14 @@ void D3D12CommandProcessor::IssueSwap(uint32_t frontbuffer_ptr, uint32_t frontbu } void D3D12CommandProcessor::OnPrimaryBufferEnd() { - if (REXCVAR_GET(d3d12_submit_on_primary_buffer_end) && submission_open_ && + // While the native guest-output renderer is suppressing emulated draws, + // batch everything into the end-of-frame submission: the mid-frame + // primary-buffer submits carry only the small exempt composition passes, + // and the GPU then idles until the native pass arrives (a measured + // ~0.3 ms/frame starvation bubble). The emulated path keeps the + // per-buffer submits for its own pacing. + if (REXCVAR_GET(d3d12_submit_on_primary_buffer_end) && + !ShouldSuppressEmulatedDraws() && submission_open_ && CanEndSubmissionImmediately()) { EndSubmission(false); }