diff options
| author | 2020-02-20 11:55:32 -0400 | |
|---|---|---|
| committer | 2020-04-22 11:36:17 -0400 | |
| commit | 1fb516cd979ed0dbf8fa7cb4f6a334932dfb6434 (patch) | |
| tree | 123d3f3e906e1af35c4bbced2d9029bc93fb4653 /src/video_core/gpu.h | |
| parent | FenceManager: Manage syncpoints and rename fences to semaphores. (diff) | |
| download | yuzu-1fb516cd979ed0dbf8fa7cb4f6a334932dfb6434.tar.gz yuzu-1fb516cd979ed0dbf8fa7cb4f6a334932dfb6434.tar.xz yuzu-1fb516cd979ed0dbf8fa7cb4f6a334932dfb6434.zip | |
GPU: Implement Flush Requests for Async mode.
Diffstat (limited to 'src/video_core/gpu.h')
| -rw-r--r-- | src/video_core/gpu.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/video_core/gpu.h b/src/video_core/gpu.h index fa9991c87..943a5b110 100644 --- a/src/video_core/gpu.h +++ b/src/video_core/gpu.h | |||
| @@ -159,6 +159,14 @@ public: | |||
| 159 | void SyncGuestHost(); | 159 | void SyncGuestHost(); |
| 160 | virtual void OnCommandListEnd(); | 160 | virtual void OnCommandListEnd(); |
| 161 | 161 | ||
| 162 | u64 RequestFlush(CacheAddr addr, std::size_t size); | ||
| 163 | |||
| 164 | u64 CurrentFlushRequestFence() const { | ||
| 165 | return current_flush_fence.load(std::memory_order_relaxed); | ||
| 166 | } | ||
| 167 | |||
| 168 | void TickWork(); | ||
| 169 | |||
| 162 | /// Returns a reference to the Maxwell3D GPU engine. | 170 | /// Returns a reference to the Maxwell3D GPU engine. |
| 163 | Engines::Maxwell3D& Maxwell3D(); | 171 | Engines::Maxwell3D& Maxwell3D(); |
| 164 | 172 | ||
| @@ -327,6 +335,19 @@ private: | |||
| 327 | 335 | ||
| 328 | std::condition_variable sync_cv; | 336 | std::condition_variable sync_cv; |
| 329 | 337 | ||
| 338 | struct FlushRequest { | ||
| 339 | FlushRequest(u64 fence, CacheAddr addr, std::size_t size) | ||
| 340 | : fence{fence}, addr{addr}, size{size} {} | ||
| 341 | u64 fence; | ||
| 342 | CacheAddr addr; | ||
| 343 | std::size_t size; | ||
| 344 | }; | ||
| 345 | |||
| 346 | std::list<FlushRequest> flush_requests; | ||
| 347 | std::atomic<u64> current_flush_fence{}; | ||
| 348 | u64 last_flush_fence{}; | ||
| 349 | std::mutex flush_request_mutex; | ||
| 350 | |||
| 330 | const bool is_async; | 351 | const bool is_async; |
| 331 | }; | 352 | }; |
| 332 | 353 | ||