summaryrefslogtreecommitdiff
path: root/src/video_core/engines/puller.cpp
diff options
context:
space:
mode:
authorGravatar Fernando Sahmkow2022-02-07 07:52:04 +0100
committerGravatar Fernando Sahmkow2022-10-06 21:00:53 +0200
commita9ca39f8591532ba6d37f7a3e068d5eefe416464 (patch)
tree0c469d2c853592c7f23095bfea40784fed471ae9 /src/video_core/engines/puller.cpp
parentBuffer Cache: Basic fixes. (diff)
downloadyuzu-a9ca39f8591532ba6d37f7a3e068d5eefe416464.tar.gz
yuzu-a9ca39f8591532ba6d37f7a3e068d5eefe416464.tar.xz
yuzu-a9ca39f8591532ba6d37f7a3e068d5eefe416464.zip
NVDRV: Further improvements.
Diffstat (limited to 'src/video_core/engines/puller.cpp')
-rw-r--r--src/video_core/engines/puller.cpp18
1 files changed, 4 insertions, 14 deletions
diff --git a/src/video_core/engines/puller.cpp b/src/video_core/engines/puller.cpp
index dd9494efa..c3ed11c13 100644
--- a/src/video_core/engines/puller.cpp
+++ b/src/video_core/engines/puller.cpp
@@ -59,6 +59,7 @@ void Puller::ProcessFenceActionMethod() {
59 case Puller::FenceOperation::Acquire: 59 case Puller::FenceOperation::Acquire:
60 // UNIMPLEMENTED_MSG("Channel Scheduling pending."); 60 // UNIMPLEMENTED_MSG("Channel Scheduling pending.");
61 // WaitFence(regs.fence_action.syncpoint_id, regs.fence_value); 61 // WaitFence(regs.fence_action.syncpoint_id, regs.fence_value);
62 rasterizer->ReleaseFences();
62 break; 63 break;
63 case Puller::FenceOperation::Increment: 64 case Puller::FenceOperation::Increment:
64 rasterizer->SignalSyncPoint(regs.fence_action.syncpoint_id); 65 rasterizer->SignalSyncPoint(regs.fence_action.syncpoint_id);
@@ -73,19 +74,11 @@ void Puller::ProcessSemaphoreTriggerMethod() {
73 const auto op = 74 const auto op =
74 static_cast<GpuSemaphoreOperation>(regs.semaphore_trigger & semaphoreOperationMask); 75 static_cast<GpuSemaphoreOperation>(regs.semaphore_trigger & semaphoreOperationMask);
75 if (op == GpuSemaphoreOperation::WriteLong) { 76 if (op == GpuSemaphoreOperation::WriteLong) {
76 struct Block {
77 u32 sequence;
78 u32 zeros = 0;
79 u64 timestamp;
80 };
81
82 const GPUVAddr sequence_address{regs.semaphore_address.SemaphoreAddress()}; 77 const GPUVAddr sequence_address{regs.semaphore_address.SemaphoreAddress()};
83 const u32 payload = regs.semaphore_sequence; 78 const u32 payload = regs.semaphore_sequence;
84 std::function<void()> operation([this, sequence_address, payload] { 79 std::function<void()> operation([this, sequence_address, payload] {
85 Block block{}; 80 memory_manager.Write<u64>(sequence_address + sizeof(u64), gpu.GetTicks());
86 block.sequence = payload; 81 memory_manager.Write<u64>(sequence_address, payload);
87 block.timestamp = gpu.GetTicks();
88 memory_manager.WriteBlock(sequence_address, &block, sizeof(block));
89 }); 82 });
90 rasterizer->SignalFence(std::move(operation)); 83 rasterizer->SignalFence(std::move(operation));
91 } else { 84 } else {
@@ -98,7 +91,6 @@ void Puller::ProcessSemaphoreTriggerMethod() {
98 regs.acquire_mode = false; 91 regs.acquire_mode = false;
99 if (word != regs.acquire_value) { 92 if (word != regs.acquire_value) {
100 rasterizer->ReleaseFences(); 93 rasterizer->ReleaseFences();
101 std::this_thread::sleep_for(std::chrono::milliseconds(1));
102 continue; 94 continue;
103 } 95 }
104 } else if (op == GpuSemaphoreOperation::AcquireGequal) { 96 } else if (op == GpuSemaphoreOperation::AcquireGequal) {
@@ -106,13 +98,11 @@ void Puller::ProcessSemaphoreTriggerMethod() {
106 regs.acquire_mode = true; 98 regs.acquire_mode = true;
107 if (word < regs.acquire_value) { 99 if (word < regs.acquire_value) {
108 rasterizer->ReleaseFences(); 100 rasterizer->ReleaseFences();
109 std::this_thread::sleep_for(std::chrono::milliseconds(1));
110 continue; 101 continue;
111 } 102 }
112 } else if (op == GpuSemaphoreOperation::AcquireMask) { 103 } else if (op == GpuSemaphoreOperation::AcquireMask) {
113 if (word && regs.semaphore_sequence == 0) { 104 if (word && regs.semaphore_sequence == 0) {
114 rasterizer->ReleaseFences(); 105 rasterizer->ReleaseFences();
115 std::this_thread::sleep_for(std::chrono::milliseconds(1));
116 continue; 106 continue;
117 } 107 }
118 } else { 108 } else {
@@ -128,7 +118,7 @@ void Puller::ProcessSemaphoreRelease() {
128 std::function<void()> operation([this, sequence_address, payload] { 118 std::function<void()> operation([this, sequence_address, payload] {
129 memory_manager.Write<u32>(sequence_address, payload); 119 memory_manager.Write<u32>(sequence_address, payload);
130 }); 120 });
131 rasterizer->SignalFence(std::move(operation)); 121 rasterizer->SyncOperation(std::move(operation));
132} 122}
133 123
134void Puller::ProcessSemaphoreAcquire() { 124void Puller::ProcessSemaphoreAcquire() {