From 409a6f5c3f5a69a3dc5148ea56521d9ac8032ac9 Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Thu, 21 Oct 2021 23:56:11 +0000 Subject: [PATCH] [d3d11] Use atomics for NVX handles Primarily to make DXVK native happy, but also much cleaner. Signed-off-by: Joshua Ashton --- src/d3d11/d3d11_device.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/d3d11/d3d11_device.cpp b/src/d3d11/d3d11_device.cpp index 33ee28f29..e6bfc9786 100644 --- a/src/d3d11/d3d11_device.cpp +++ b/src/d3d11/d3d11_device.cpp @@ -2721,8 +2721,8 @@ namespace dxvk { } // for our purposes the actual value doesn't matter, only its uniqueness - static ULONG seqNum = 1; - *pDriverHandle = InterlockedIncrement(&seqNum); + static std::atomic s_seqNum = 0; + *pDriverHandle = ++s_seqNum; // will need to look-up sampler from uint32 handle later AddSamplerAndHandleNVX(*ppSamplerState, *pDriverHandle);