summaryrefslogtreecommitdiff
path: root/src/video_core/fence_manager.h
diff options
context:
space:
mode:
authorGravatar Fernando Sahmkow2021-07-06 22:23:10 +0200
committerGravatar Fernando Sahmkow2021-07-09 22:20:36 +0200
commit63915bf2de3358029cb5e904f51f6b147b64bfa1 (patch)
tree590fda8b8ef117ac71499443bb89dfd031d271c9 /src/video_core/fence_manager.h
parentVideocore: Address Feedback & CLANG Format. (diff)
downloadyuzu-63915bf2de3358029cb5e904f51f6b147b64bfa1.tar.gz
yuzu-63915bf2de3358029cb5e904f51f6b147b64bfa1.tar.xz
yuzu-63915bf2de3358029cb5e904f51f6b147b64bfa1.zip
Fence Manager: Add fences on Reference Count.
Diffstat (limited to 'src/video_core/fence_manager.h')
-rw-r--r--src/video_core/fence_manager.h24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/video_core/fence_manager.h b/src/video_core/fence_manager.h
index f055b61e9..cd17667cb 100644
--- a/src/video_core/fence_manager.h
+++ b/src/video_core/fence_manager.h
@@ -8,6 +8,7 @@
8#include <queue> 8#include <queue>
9 9
10#include "common/common_types.h" 10#include "common/common_types.h"
11#include "common/settings.h"
11#include "core/core.h" 12#include "core/core.h"
12#include "video_core/delayed_destruction_ring.h" 13#include "video_core/delayed_destruction_ring.h"
13#include "video_core/gpu.h" 14#include "video_core/gpu.h"
@@ -53,6 +54,23 @@ public:
53 delayed_destruction_ring.Tick(); 54 delayed_destruction_ring.Tick();
54 } 55 }
55 56
57 void SignalReference() {
58 // Only sync references on High
59 if (Settings::values.gpu_accuracy.GetValue() != Settings::GPUAccuracy::High) {
60 return;
61 }
62 TryReleasePendingFences();
63 const bool should_flush = ShouldFlush();
64 CommitAsyncFlushes();
65 TFence new_fence = CreateFence(0, 0, !should_flush);
66 fences.push(new_fence);
67 QueueFence(new_fence);
68 if (should_flush) {
69 rasterizer.FlushCommands();
70 }
71 rasterizer.SyncGuestHost();
72 }
73
56 void SignalSemaphore(GPUVAddr addr, u32 value) { 74 void SignalSemaphore(GPUVAddr addr, u32 value) {
57 TryReleasePendingFences(); 75 TryReleasePendingFences();
58 const bool should_flush = ShouldFlush(); 76 const bool should_flush = ShouldFlush();
@@ -87,8 +105,10 @@ public:
87 } 105 }
88 PopAsyncFlushes(); 106 PopAsyncFlushes();
89 if (current_fence->IsSemaphore()) { 107 if (current_fence->IsSemaphore()) {
90 gpu_memory.template Write<u32>(current_fence->GetAddress(), 108 if (current_fence->GetAddress() != 0) {
91 current_fence->GetPayload()); 109 gpu_memory.template Write<u32>(current_fence->GetAddress(),
110 current_fence->GetPayload());
111 }
92 } else { 112 } else {
93 gpu.IncrementSyncPoint(current_fence->GetPayload()); 113 gpu.IncrementSyncPoint(current_fence->GetPayload());
94 } 114 }