summaryrefslogtreecommitdiff
path: root/src/video_core/gpu.cpp
diff options
context:
space:
mode:
authorGravatar Fernando Sahmkow2022-02-06 01:16:11 +0100
committerGravatar Fernando Sahmkow2022-10-06 21:00:52 +0200
commitbc8b3d225eda388f0603830cbff8357893abb0f9 (patch)
tree479b41b73913feceeeb0c9c6f3147d6491c0fa04 /src/video_core/gpu.cpp
parentMemoryManager: initial multi paging system implementation. (diff)
downloadyuzu-bc8b3d225eda388f0603830cbff8357893abb0f9.tar.gz
yuzu-bc8b3d225eda388f0603830cbff8357893abb0f9.tar.xz
yuzu-bc8b3d225eda388f0603830cbff8357893abb0f9.zip
VideoCore: Refactor fencing system.
Diffstat (limited to 'src/video_core/gpu.cpp')
-rw-r--r--src/video_core/gpu.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp
index a1d19b1c8..d7a3dd96b 100644
--- a/src/video_core/gpu.cpp
+++ b/src/video_core/gpu.cpp
@@ -93,16 +93,13 @@ struct GPU::Impl {
93 } 93 }
94 94
95 /// Synchronizes CPU writes with Host GPU memory. 95 /// Synchronizes CPU writes with Host GPU memory.
96 void SyncGuestHost() { 96 void InvalidateGPUCache() {
97 rasterizer->SyncGuestHost(); 97 rasterizer->InvalidateGPUCache();
98 } 98 }
99 99
100 /// Signal the ending of command list. 100 /// Signal the ending of command list.
101 void OnCommandListEnd() { 101 void OnCommandListEnd() {
102 if (is_async) { 102 gpu_thread.OnCommandListEnd();
103 // This command only applies to asynchronous GPU mode
104 gpu_thread.OnCommandListEnd();
105 }
106 } 103 }
107 104
108 /// Request a host GPU memory flush from the CPU. 105 /// Request a host GPU memory flush from the CPU.
@@ -296,7 +293,7 @@ struct GPU::Impl {
296 } 293 }
297 294
298 void RequestSwapBuffers(const Tegra::FramebufferConfig* framebuffer, 295 void RequestSwapBuffers(const Tegra::FramebufferConfig* framebuffer,
299 Service::Nvidia::NvFence* fences, size_t num_fences) { 296 std::array<Service::Nvidia::NvFence, 4>& fences, size_t num_fences) {
300 size_t current_request_counter{}; 297 size_t current_request_counter{};
301 { 298 {
302 std::unique_lock<std::mutex> lk(request_swap_mutex); 299 std::unique_lock<std::mutex> lk(request_swap_mutex);
@@ -412,8 +409,8 @@ void GPU::FlushCommands() {
412 impl->FlushCommands(); 409 impl->FlushCommands();
413} 410}
414 411
415void GPU::SyncGuestHost() { 412void GPU::InvalidateGPUCache() {
416 impl->SyncGuestHost(); 413 impl->InvalidateGPUCache();
417} 414}
418 415
419void GPU::OnCommandListEnd() { 416void GPU::OnCommandListEnd() {
@@ -488,7 +485,7 @@ const VideoCore::ShaderNotify& GPU::ShaderNotify() const {
488} 485}
489 486
490void GPU::RequestSwapBuffers(const Tegra::FramebufferConfig* framebuffer, 487void GPU::RequestSwapBuffers(const Tegra::FramebufferConfig* framebuffer,
491 Service::Nvidia::NvFence* fences, size_t num_fences) { 488 std::array<Service::Nvidia::NvFence, 4>& fences, size_t num_fences) {
492 impl->RequestSwapBuffers(framebuffer, fences, num_fences); 489 impl->RequestSwapBuffers(framebuffer, fences, num_fences);
493} 490}
494 491