diff options
| author | cirakg <cirakg@cirakg.xyz> | 2026-11-02 22:58:00 +0100 |
|---|---|---|
| committer | cirakg <cirakg@cirakg.xyz> | 2026-11-02 22:58:00 +0100 |
| commit | cf0502ad274022480cb264e0e75390863cd49608 (patch) | |
| tree | fd672b27a4cbddffb3acbb09ee59d3dd96ba489c /src/video_core/gpu_split.h | |
| parent | ff234849d6a41d2c2d29cf09408ac66e202d68e7 (diff) | |
| parent | 0da830e94169b9040007b69c8147ab00b6574e36 (diff) | |
Merge branch 'nx2' into ldn/room-handshake
Diffstat (limited to 'src/video_core/gpu_split.h')
| -rw-r--r-- | src/video_core/gpu_split.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/video_core/gpu_split.h b/src/video_core/gpu_split.h index d6f91e4141..c7c7118481 100644 --- a/src/video_core/gpu_split.h +++ b/src/video_core/gpu_split.h @@ -100,6 +100,13 @@ public: /// Waits until the back executed everything sent so far. void Drain(); + /// Compute or copy work was just sent: what can write GPU-written command lists. + void NoteWriter() { + last_writer_position = write_position; + } + /// Waits until the back executed the compute and copy work sent so far (not what came after). + void WaitForWriters(); + private: enum class Kind : u64 { Wrap, ///< The rest of the ring is unused: continue at its start @@ -156,6 +163,7 @@ private: // Front side. u64 write_position{}; + u64 last_writer_position{}; u64 published_local{}; u64 consumed_cache{}; /// Words between publishes: small right after a drain, while the back has nothing to do. @@ -169,6 +177,8 @@ private: alignas(64) std::atomic<u64> published{}; alignas(64) std::atomic<u64> consumed{}; + /// A position the front waits for (WaitForWriters): the back stores `consumed` once past it. + alignas(64) std::atomic<u64> wait_target{~u64{0}}; alignas(64) std::atomic<bool> back_waiting{}; std::atomic<u32> wake{}; std::jthread back_thread; |
