summaryrefslogtreecommitdiffstats
path: root/src/video_core/gpu.cpp
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2019-06-07 18:56:30 +0200
committerFernandoS27 <fsahmkow27@gmail.com>2019-07-05 21:49:11 +0200
commit82b829625b89a706dd0d867c529f533fe928710c (patch)
tree1d5e4bfcde8843e377ae51e3f0741b9abaa1a26a /src/video_core/gpu.cpp
parentnv_services: Correct buffer queue fencing and GPFifo fencing (diff)
downloadyuzu-82b829625b89a706dd0d867c529f533fe928710c.tar
yuzu-82b829625b89a706dd0d867c529f533fe928710c.tar.gz
yuzu-82b829625b89a706dd0d867c529f533fe928710c.tar.bz2
yuzu-82b829625b89a706dd0d867c529f533fe928710c.tar.lz
yuzu-82b829625b89a706dd0d867c529f533fe928710c.tar.xz
yuzu-82b829625b89a706dd0d867c529f533fe928710c.tar.zst
yuzu-82b829625b89a706dd0d867c529f533fe928710c.zip
Diffstat (limited to '')
-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 {
return *dma_pusher;
}
+void GPU::IncrementSyncPoint(const u32 syncpoint_id) {
+ syncpoints[syncpoint_id]++;
+ if (!events[syncpoint_id].empty()) {
+ u32 value = syncpoints[syncpoint_id].load();
+ auto it = events[syncpoint_id].begin();
+ while (it != events[syncpoint_id].end()) {
+ if (value >= it->value) {
+ TriggerCpuInterrupt(it->event_id);
+ it = events[syncpoint_id].erase(it);
+ continue;
+ }
+ it++;
+ }
+ }
+}
+
+u32 GPU::GetSyncpointValue(const u32 syncpoint_id) const {
+ return syncpoints[syncpoint_id].load();
+}
+
+void GPU::RegisterEvent(const u32 event_id, const u32 syncpoint_id, const u32 value) {
+ events[syncpoint_id].emplace_back(event_id, value);
+}
+
u32 RenderTargetBytesPerPixel(RenderTargetFormat format) {
ASSERT(format != RenderTargetFormat::NONE);