diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2020-02-20 16:55:32 +0100 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2020-04-22 17:36:17 +0200 |
commit | 1fb516cd979ed0dbf8fa7cb4f6a334932dfb6434 (patch) | |
tree | 123d3f3e906e1af35c4bbced2d9029bc93fb4653 /src/video_core/gpu.cpp | |
parent | FenceManager: Manage syncpoints and rename fences to semaphores. (diff) | |
download | yuzu-1fb516cd979ed0dbf8fa7cb4f6a334932dfb6434.tar yuzu-1fb516cd979ed0dbf8fa7cb4f6a334932dfb6434.tar.gz yuzu-1fb516cd979ed0dbf8fa7cb4f6a334932dfb6434.tar.bz2 yuzu-1fb516cd979ed0dbf8fa7cb4f6a334932dfb6434.tar.lz yuzu-1fb516cd979ed0dbf8fa7cb4f6a334932dfb6434.tar.xz yuzu-1fb516cd979ed0dbf8fa7cb4f6a334932dfb6434.tar.zst yuzu-1fb516cd979ed0dbf8fa7cb4f6a334932dfb6434.zip |
Diffstat (limited to '')
-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) { return true; } +u64 GPU::RequestFlush(CacheAddr addr, std::size_t size) { + std::unique_lock lck{flush_request_mutex}; + const u64 fence = ++last_flush_fence; + flush_requests.emplace_back(fence, addr, size); + return fence; +} + +void GPU::TickWork() { + std::unique_lock lck{flush_request_mutex}; + while (!flush_requests.empty()) { + auto& request = flush_requests.front(); + const u64 fence = request.fence; + const CacheAddr addr = request.addr; + const std::size_t size = request.size; + flush_requests.pop_front(); + flush_request_mutex.unlock(); + renderer->Rasterizer().FlushRegion(addr, size); + current_flush_fence.store(fence); + flush_request_mutex.lock(); + } +} + u64 GPU::GetTicks() const { // This values were reversed engineered by fincs from NVN // The gpu clock is reported in units of 385/625 nanoseconds |