summaryrefslogtreecommitdiff
path: root/src/video_core/gpu.cpp
diff options
context:
space:
mode:
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