summaryrefslogtreecommitdiffstats
path: root/src/video_core/gpu.cpp
diff options
context:
space:
mode:
authorMarkus Wick <markus@selfnet.de>2019-12-30 13:03:20 +0100
committerMarkus Wick <markus@selfnet.de>2019-12-30 13:04:53 +0100
commitcb9dd01ffd3f54f5592330e3a37e2b26975bf209 (patch)
treedc41e5bea7e4844fceebbbb2d7481eb026bfcfd9 /src/video_core/gpu.cpp
parentMerge pull request #3250 from ReinUsesLisp/empty-fragment (diff)
downloadyuzu-cb9dd01ffd3f54f5592330e3a37e2b26975bf209.tar
yuzu-cb9dd01ffd3f54f5592330e3a37e2b26975bf209.tar.gz
yuzu-cb9dd01ffd3f54f5592330e3a37e2b26975bf209.tar.bz2
yuzu-cb9dd01ffd3f54f5592330e3a37e2b26975bf209.tar.lz
yuzu-cb9dd01ffd3f54f5592330e3a37e2b26975bf209.tar.xz
yuzu-cb9dd01ffd3f54f5592330e3a37e2b26975bf209.tar.zst
yuzu-cb9dd01ffd3f54f5592330e3a37e2b26975bf209.zip
Diffstat (limited to 'src/video_core/gpu.cpp')
-rw-r--r--src/video_core/gpu.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp
index 095660115..b9c5c41a2 100644
--- a/src/video_core/gpu.cpp
+++ b/src/video_core/gpu.cpp
@@ -66,19 +66,20 @@ const DmaPusher& GPU::DmaPusher() const {
return *dma_pusher;
}
-void GPU::WaitFence(u32 syncpoint_id, u32 value) const {
+void GPU::WaitFence(u32 syncpoint_id, u32 value) {
// Synced GPU, is always in sync
if (!is_async) {
return;
}
MICROPROFILE_SCOPE(GPU_wait);
- while (syncpoints[syncpoint_id].load(std::memory_order_relaxed) < value) {
- }
+ std::unique_lock lock{sync_mutex};
+ sync_cv.wait(lock, [=]() { return syncpoints[syncpoint_id].load() >= value; });
}
void GPU::IncrementSyncPoint(const u32 syncpoint_id) {
syncpoints[syncpoint_id]++;
std::lock_guard lock{sync_mutex};
+ sync_cv.notify_all();
if (!syncpt_interrupts[syncpoint_id].empty()) {
u32 value = syncpoints[syncpoint_id].load();
auto it = syncpt_interrupts[syncpoint_id].begin();