From a6357a254d3c35e14cf4fa323e658efd126ea9d1 Mon Sep 17 00:00:00 2001 From: Robin Kertels Date: Fri, 11 Mar 2022 22:24:58 +0100 Subject: [PATCH] [d3d9] Fix CS thread synchronization for directly mapped buffers --- src/d3d9/d3d9_common_buffer.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/d3d9/d3d9_common_buffer.h b/src/d3d9/d3d9_common_buffer.h index e95e43d0..c3bc413c 100644 --- a/src/d3d9/d3d9_common_buffer.h +++ b/src/d3d9/d3d9_common_buffer.h @@ -1,6 +1,7 @@ #pragma once #include "../dxvk/dxvk_device.h" +#include "../dxvk/dxvk_cs.h" #include "d3d9_device_child.h" #include "d3d9_format.h" @@ -194,6 +195,10 @@ namespace dxvk { void PreLoad(); + bool HasSequenceNumber() const { + return m_mapMode != D3D9_COMMON_BUFFER_MAP_MODE_DIRECT; + } + /** * \brief Tracks sequence number * @@ -213,7 +218,8 @@ namespace dxvk { * \returns Sequence number for the given subresource */ uint64_t GetMappingBufferSequenceNumber() const { - return m_seq; + return HasSequenceNumber() ? m_seq + : DxvkCsThread::SynchronizeAll; } private: