summaryrefslogtreecommitdiffstats
path: root/src/video_core/gpu.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2020-04-23 04:09:38 +0200
committerGitHub <noreply@github.com>2020-04-23 04:09:38 +0200
commitbf2ddb8fd5feaeaf2806fe102de8e3089f893137 (patch)
treeb97d388da23608c00808b6662e3c0564fc4f6d59 /src/video_core/gpu.h
parentMerge pull request #3767 from ReinUsesLisp/point-size-pipeline (diff)
parentGL_Fence_Manager: use GL_TIMEOUT_IGNORED instead of a loop, (diff)
downloadyuzu-bf2ddb8fd5feaeaf2806fe102de8e3089f893137.tar
yuzu-bf2ddb8fd5feaeaf2806fe102de8e3089f893137.tar.gz
yuzu-bf2ddb8fd5feaeaf2806fe102de8e3089f893137.tar.bz2
yuzu-bf2ddb8fd5feaeaf2806fe102de8e3089f893137.tar.lz
yuzu-bf2ddb8fd5feaeaf2806fe102de8e3089f893137.tar.xz
yuzu-bf2ddb8fd5feaeaf2806fe102de8e3089f893137.tar.zst
yuzu-bf2ddb8fd5feaeaf2806fe102de8e3089f893137.zip
Diffstat (limited to 'src/video_core/gpu.h')
-rw-r--r--src/video_core/gpu.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/video_core/gpu.h b/src/video_core/gpu.h
index 1a2d747be..5e3eb94e9 100644
--- a/src/video_core/gpu.h
+++ b/src/video_core/gpu.h
@@ -155,7 +155,23 @@ public:
/// Calls a GPU method.
void CallMethod(const MethodCall& method_call);
+ /// Flush all current written commands into the host GPU for execution.
void FlushCommands();
+ /// Synchronizes CPU writes with Host GPU memory.
+ void SyncGuestHost();
+ /// Signal the ending of command list.
+ virtual void OnCommandListEnd();
+
+ /// Request a host GPU memory flush from the CPU.
+ u64 RequestFlush(VAddr addr, std::size_t size);
+
+ /// Obtains current flush request fence id.
+ u64 CurrentFlushRequestFence() const {
+ return current_flush_fence.load(std::memory_order_relaxed);
+ }
+
+ /// Tick pending requests within the GPU.
+ void TickWork();
/// Returns a reference to the Maxwell3D GPU engine.
Engines::Maxwell3D& Maxwell3D();
@@ -325,6 +341,19 @@ private:
std::condition_variable sync_cv;
+ struct FlushRequest {
+ FlushRequest(u64 fence, VAddr addr, std::size_t size)
+ : fence{fence}, addr{addr}, size{size} {}
+ u64 fence;
+ VAddr addr;
+ std::size_t size;
+ };
+
+ std::list<FlushRequest> flush_requests;
+ std::atomic<u64> current_flush_fence{};
+ u64 last_flush_fence{};
+ std::mutex flush_request_mutex;
+
const bool is_async;
};