From 7e42939a4a7efa32834ff159089e5007b09849d9 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Wed, 22 Jun 2022 00:39:36 +0200 Subject: [PATCH] [d3d11] Call endFrame at the end of each frame --- src/d3d11/d3d11_context_imm.cpp | 7 +++++++ src/d3d11/d3d11_context_imm.h | 2 ++ src/d3d11/d3d11_swapchain.cpp | 1 + 3 files changed, 10 insertions(+) diff --git a/src/d3d11/d3d11_context_imm.cpp b/src/d3d11/d3d11_context_imm.cpp index 536aef85..15e4accf 100644 --- a/src/d3d11/d3d11_context_imm.cpp +++ b/src/d3d11/d3d11_context_imm.cpp @@ -682,6 +682,13 @@ namespace dxvk { } + void D3D11ImmediateContext::EndFrame() { + EmitCs([] (DxvkContext* ctx) { + ctx->endFrame(); + }); + } + + bool D3D11ImmediateContext::WaitForResource( const Rc& Resource, uint64_t SequenceNumber, diff --git a/src/d3d11/d3d11_context_imm.h b/src/d3d11/d3d11_context_imm.h index 9a5ba21f..6bc1e6da 100644 --- a/src/d3d11/d3d11_context_imm.h +++ b/src/d3d11/d3d11_context_imm.h @@ -158,6 +158,8 @@ namespace dxvk { UINT CopyFlags); void SynchronizeDevice(); + + void EndFrame(); bool WaitForResource( const Rc& Resource, diff --git a/src/d3d11/d3d11_swapchain.cpp b/src/d3d11/d3d11_swapchain.cpp index b6ba21e1..771ade12 100644 --- a/src/d3d11/d3d11_swapchain.cpp +++ b/src/d3d11/d3d11_swapchain.cpp @@ -259,6 +259,7 @@ namespace dxvk { // Flush pending rendering commands before auto immediateContext = static_cast(deviceContext.ptr()); + immediateContext->EndFrame(); immediateContext->Flush(); // Bump our frame id.