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.cpp | |
| 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.cpp')
| -rw-r--r-- | src/video_core/gpu.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp index 19d3bd305..85a6c7bb5 100644 --- a/src/video_core/gpu.cpp +++ b/src/video_core/gpu.cpp | |||
| @@ -125,6 +125,28 @@ bool GPU::CancelSyncptInterrupt(const u32 syncpoint_id, const u32 value) { | |||
| 125 | return true; | 125 | return true; |
| 126 | } | 126 | } |
| 127 | 127 | ||
| 128 | u64 GPU::RequestFlush(CacheAddr addr, std::size_t size) { | ||
| 129 | std::unique_lock lck{flush_request_mutex}; | ||
| 130 | const u64 fence = ++last_flush_fence; | ||
| 131 | flush_requests.emplace_back(fence, addr, size); | ||
| 132 | return fence; | ||
| 133 | } | ||
| 134 | |||
| 135 | void GPU::TickWork() { | ||
| 136 | std::unique_lock lck{flush_request_mutex}; | ||
| 137 | while (!flush_requests.empty()) { | ||
| 138 | auto& request = flush_requests.front(); | ||
| 139 | const u64 fence = request.fence; | ||
| 140 | const CacheAddr addr = request.addr; | ||
| 141 | const std::size_t size = request.size; | ||
| 142 | flush_requests.pop_front(); | ||
| 143 | flush_request_mutex.unlock(); | ||
| 144 | renderer->Rasterizer().FlushRegion(addr, size); | ||
| 145 | current_flush_fence.store(fence); | ||
| 146 | flush_request_mutex.lock(); | ||
| 147 | } | ||
| 148 | } | ||
| 149 | |||
| 128 | u64 GPU::GetTicks() const { | 150 | u64 GPU::GetTicks() const { |
| 129 | // This values were reversed engineered by fincs from NVN | 151 | // This values were reversed engineered by fincs from NVN |
| 130 | // The gpu clock is reported in units of 385/625 nanoseconds | 152 | // The gpu clock is reported in units of 385/625 nanoseconds |