From e6fb49fa4bb2864702abcefc14f6bb62eaba7a7e Mon Sep 17 00:00:00 2001 From: Markus Wick Date: Wed, 7 Apr 2021 13:57:49 +0200 Subject: video_core/gpu_thread: Keep the write lock for allocating the fence. Else the fence might get submited out-of-order into the queue, which makes testing them pointless. Overhead should be tiny as the mutex is just moved from the queue to the writing code. --- src/video_core/gpu_thread.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/video_core/gpu_thread.h') diff --git a/src/video_core/gpu_thread.h b/src/video_core/gpu_thread.h index d384164de..cb901c22a 100644 --- a/src/video_core/gpu_thread.h +++ b/src/video_core/gpu_thread.h @@ -101,7 +101,8 @@ struct CommandDataContainer { struct SynchState final { std::atomic_bool is_running{true}; - using CommandQueue = Common::MPSCQueue; + using CommandQueue = Common::SPSCQueue; + std::mutex write_lock; CommandQueue queue; u64 last_fence{}; std::atomic signaled_fence{}; -- cgit v1.2.3