From a6483e02fe28b5472b237e6fe80fd9226da05378 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Thu, 14 Nov 2019 22:57:30 +0100 Subject: [PATCH] [d3d11] Submit stalling event queries before flushing Otherwise, instead of preventing syncs, this would actually have the opposite effect. --- src/d3d11/d3d11_context_imm.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/d3d11/d3d11_context_imm.cpp b/src/d3d11/d3d11_context_imm.cpp index f24bae1fc..097451a6d 100644 --- a/src/d3d11/d3d11_context_imm.cpp +++ b/src/d3d11/d3d11_context_imm.cpp @@ -104,12 +104,12 @@ namespace dxvk { if (unlikely(!pAsync)) return; - Com query(static_cast(pAsync)); + auto query = static_cast(pAsync); if (unlikely(!query->DoBegin())) return; - EmitCs([cQuery = std::move(query)] + EmitCs([cQuery = Com(query)] (DxvkContext* ctx) { cQuery->Begin(ctx); }); @@ -122,22 +122,22 @@ namespace dxvk { if (unlikely(!pAsync)) return; - Com query(static_cast(pAsync)); + auto query = static_cast(pAsync); if (unlikely(!query->DoEnd())) return; + EmitCs([cQuery = Com(query)] + (DxvkContext* ctx) { + cQuery->End(ctx); + }); + if (unlikely(query->IsEvent())) { query->NotifyEnd(); query->IsStalling() ? Flush() : FlushImplicit(TRUE); } - - EmitCs([cQuery = std::move(query)] - (DxvkContext* ctx) { - cQuery->End(ctx); - }); }