summaryrefslogtreecommitdiff
path: root/src/video_core/gpu.cpp
diff options
context:
space:
mode:
authorGravatar Fernando Sahmkow2019-06-07 12:56:30 -0400
committerGravatar FernandoS272019-07-05 15:49:11 -0400
commit82b829625b89a706dd0d867c529f533fe928710c (patch)
tree1d5e4bfcde8843e377ae51e3f0741b9abaa1a26a /src/video_core/gpu.cpp
parentnv_services: Correct buffer queue fencing and GPFifo fencing (diff)
downloadyuzu-82b829625b89a706dd0d867c529f533fe928710c.tar.gz
yuzu-82b829625b89a706dd0d867c529f533fe928710c.tar.xz
yuzu-82b829625b89a706dd0d867c529f533fe928710c.zip
video_core: Implement GPU side Syncpoints
Diffstat (limited to 'src/video_core/gpu.cpp')
-rw-r--r--src/video_core/gpu.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp
index 52706505b..1d12f0493 100644
--- a/src/video_core/gpu.cpp
+++ b/src/video_core/gpu.cpp
@@ -66,6 +66,30 @@ const DmaPusher& GPU::DmaPusher() const {
66 return *dma_pusher; 66 return *dma_pusher;
67} 67}
68 68
69void GPU::IncrementSyncPoint(const u32 syncpoint_id) {
70 syncpoints[syncpoint_id]++;
71 if (!events[syncpoint_id].empty()) {
72 u32 value = syncpoints[syncpoint_id].load();
73 auto it = events[syncpoint_id].begin();
74 while (it != events[syncpoint_id].end()) {
75 if (value >= it->value) {
76 TriggerCpuInterrupt(it->event_id);
77 it = events[syncpoint_id].erase(it);
78 continue;
79 }
80 it++;
81 }
82 }
83}
84
85u32 GPU::GetSyncpointValue(const u32 syncpoint_id) const {
86 return syncpoints[syncpoint_id].load();
87}
88
89void GPU::RegisterEvent(const u32 event_id, const u32 syncpoint_id, const u32 value) {
90 events[syncpoint_id].emplace_back(event_id, value);
91}
92
69u32 RenderTargetBytesPerPixel(RenderTargetFormat format) { 93u32 RenderTargetBytesPerPixel(RenderTargetFormat format) {
70 ASSERT(format != RenderTargetFormat::NONE); 94 ASSERT(format != RenderTargetFormat::NONE);
71 95