diff options
author | Markus Wick <markus@selfnet.de> | 2021-04-07 11:41:31 +0200 |
---|---|---|
committer | Markus Wick <markus@selfnet.de> | 2021-04-07 22:38:52 +0200 |
commit | e8bd9aed8bf0f60455d0ae6a8f6f3abf92dd8305 (patch) | |
tree | 042497b8c297e874b382f4b695bb601b6ea2d1cf /src/video_core/gpu_thread.h | |
parent | video_core/gpu_thread: Keep the write lock for allocating the fence. (diff) | |
download | yuzu-e8bd9aed8bf0f60455d0ae6a8f6f3abf92dd8305.tar yuzu-e8bd9aed8bf0f60455d0ae6a8f6f3abf92dd8305.tar.gz yuzu-e8bd9aed8bf0f60455d0ae6a8f6f3abf92dd8305.tar.bz2 yuzu-e8bd9aed8bf0f60455d0ae6a8f6f3abf92dd8305.tar.lz yuzu-e8bd9aed8bf0f60455d0ae6a8f6f3abf92dd8305.tar.xz yuzu-e8bd9aed8bf0f60455d0ae6a8f6f3abf92dd8305.tar.zst yuzu-e8bd9aed8bf0f60455d0ae6a8f6f3abf92dd8305.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/gpu_thread.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/video_core/gpu_thread.h b/src/video_core/gpu_thread.h index cb901c22a..11a648f38 100644 --- a/src/video_core/gpu_thread.h +++ b/src/video_core/gpu_thread.h @@ -90,11 +90,12 @@ using CommandData = struct CommandDataContainer { CommandDataContainer() = default; - explicit CommandDataContainer(CommandData&& data_, u64 next_fence_) - : data{std::move(data_)}, fence{next_fence_} {} + explicit CommandDataContainer(CommandData&& data_, u64 next_fence_, bool block_) + : data{std::move(data_)}, fence{next_fence_}, block(block_) {} CommandData data; u64 fence{}; + bool block{}; }; /// Struct used to synchronize the GPU thread @@ -106,6 +107,7 @@ struct SynchState final { CommandQueue queue; u64 last_fence{}; std::atomic<u64> signaled_fence{}; + std::condition_variable cv; }; /// Class used to manage the GPU thread @@ -140,10 +142,7 @@ public: private: /// Pushes a command to be executed by the GPU thread - u64 PushCommand(CommandData&& command_data); - - // Wait until the gpu thread is idle. - void WaitIdle() const; + u64 PushCommand(CommandData&& command_data, bool block = false); Core::System& system; const bool is_async; |