From bd58f1a913b3cd6b2200a38a22f885ca045f1f08 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Mon, 14 Oct 2019 00:14:00 +0200 Subject: [PATCH] [d3d11] Don't sync CS thread if resource to map is already in use SynchronizeCsThread can only update the in-use state from available to in-use, so doing this on a resource that is already in-use is not necessary. May improve performance in combination with DO_NOT_WAIT. --- src/d3d11/d3d11_context_imm.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/d3d11/d3d11_context_imm.cpp b/src/d3d11/d3d11_context_imm.cpp index 0b1c08d5e..b342fd70c 100644 --- a/src/d3d11/d3d11_context_imm.cpp +++ b/src/d3d11/d3d11_context_imm.cpp @@ -569,7 +569,8 @@ namespace dxvk { // Wait for the any pending D3D11 command to be executed // on the CS thread so that we can determine whether the // resource is currently in use or not. - SynchronizeCsThread(); + if (!Resource->isInUse(access)) + SynchronizeCsThread(); if (Resource->isInUse(access)) { if (MapFlags & D3D11_MAP_FLAG_DO_NOT_WAIT) {