summaryrefslogtreecommitdiff
path: root/src/video_core/gpu.h
diff options
context:
space:
mode:
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:
155 /// Calls a GPU method. 155 /// Calls a GPU method.
156 void CallMethod(const MethodCall& method_call); 156 void CallMethod(const MethodCall& method_call);
157 157
158 /// Flush all current written commands into the host GPU for execution.
158 void FlushCommands(); 159 void FlushCommands();
160 /// Synchronizes CPU writes with Host GPU memory.
161 void SyncGuestHost();
162 /// Signal the ending of command list.
163 virtual void OnCommandListEnd();
164
165 /// Request a host GPU memory flush from the CPU.
166 u64 RequestFlush(VAddr addr, std::size_t size);
167
168 /// Obtains current flush request fence id.
169 u64 CurrentFlushRequestFence() const {
170 return current_flush_fence.load(std::memory_order_relaxed);
171 }
172
173 /// Tick pending requests within the GPU.
174 void TickWork();
159 175
160 /// Returns a reference to the Maxwell3D GPU engine. 176 /// Returns a reference to the Maxwell3D GPU engine.
161 Engines::Maxwell3D& Maxwell3D(); 177 Engines::Maxwell3D& Maxwell3D();
@@ -325,6 +341,19 @@ private:
325 341
326 std::condition_variable sync_cv; 342 std::condition_variable sync_cv;
327 343
344 struct FlushRequest {
345 FlushRequest(u64 fence, VAddr addr, std::size_t size)
346 : fence{fence}, addr{addr}, size{size} {}
347 u64 fence;
348 VAddr addr;
349 std::size_t size;
350 };
351
352 std::list<FlushRequest> flush_requests;
353 std::atomic<u64> current_flush_fence{};
354 u64 last_flush_fence{};
355 std::mutex flush_request_mutex;
356
328 const bool is_async; 357 const bool is_async;
329}; 358};
330 359