diff options
| author | 2019-03-16 21:59:45 -0400 | |
|---|---|---|
| committer | 2019-03-16 21:59:45 -0400 | |
| commit | 2392e146b09c2a4b3bb557bb3a20c4afc7f75957 (patch) | |
| tree | 1eafa50be7af78d74b4781fbe858277ac8ab1d35 /src/video_core/gpu.cpp | |
| parent | Merge pull request #2243 from bunnei/mem-simplify-cache (diff) | |
| parent | video_core: Refactor to use MemoryManager interface for all memory access. (diff) | |
| download | yuzu-2392e146b09c2a4b3bb557bb3a20c4afc7f75957.tar.gz yuzu-2392e146b09c2a4b3bb557bb3a20c4afc7f75957.tar.xz yuzu-2392e146b09c2a4b3bb557bb3a20c4afc7f75957.zip | |
Merge pull request #2244 from bunnei/gpu-mem-refactor
video_core: Refactor to use MemoryManager interface for all memory access.
Diffstat (limited to 'src/video_core/gpu.cpp')
| -rw-r--r-- | src/video_core/gpu.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp index 08abf8ac9..66c690494 100644 --- a/src/video_core/gpu.cpp +++ b/src/video_core/gpu.cpp | |||
| @@ -274,7 +274,6 @@ void GPU::ProcessSemaphoreTriggerMethod() { | |||
| 274 | const auto op = | 274 | const auto op = |
| 275 | static_cast<GpuSemaphoreOperation>(regs.semaphore_trigger & semaphoreOperationMask); | 275 | static_cast<GpuSemaphoreOperation>(regs.semaphore_trigger & semaphoreOperationMask); |
| 276 | if (op == GpuSemaphoreOperation::WriteLong) { | 276 | if (op == GpuSemaphoreOperation::WriteLong) { |
| 277 | auto address = memory_manager->GpuToCpuAddress(regs.smaphore_address.SmaphoreAddress()); | ||
| 278 | struct Block { | 277 | struct Block { |
| 279 | u32 sequence; | 278 | u32 sequence; |
| 280 | u32 zeros = 0; | 279 | u32 zeros = 0; |
| @@ -286,11 +285,9 @@ void GPU::ProcessSemaphoreTriggerMethod() { | |||
| 286 | // TODO(Kmather73): Generate a real GPU timestamp and write it here instead of | 285 | // TODO(Kmather73): Generate a real GPU timestamp and write it here instead of |
| 287 | // CoreTiming | 286 | // CoreTiming |
| 288 | block.timestamp = Core::System::GetInstance().CoreTiming().GetTicks(); | 287 | block.timestamp = Core::System::GetInstance().CoreTiming().GetTicks(); |
| 289 | Memory::WriteBlock(*address, &block, sizeof(block)); | 288 | memory_manager->WriteBlock(regs.smaphore_address.SmaphoreAddress(), &block, sizeof(block)); |
| 290 | } else { | 289 | } else { |
| 291 | const auto address = | 290 | const u32 word{memory_manager->Read32(regs.smaphore_address.SmaphoreAddress())}; |
| 292 | memory_manager->GpuToCpuAddress(regs.smaphore_address.SmaphoreAddress()); | ||
| 293 | const u32 word = Memory::Read32(*address); | ||
| 294 | if ((op == GpuSemaphoreOperation::AcquireEqual && word == regs.semaphore_sequence) || | 291 | if ((op == GpuSemaphoreOperation::AcquireEqual && word == regs.semaphore_sequence) || |
| 295 | (op == GpuSemaphoreOperation::AcquireGequal && | 292 | (op == GpuSemaphoreOperation::AcquireGequal && |
| 296 | static_cast<s32>(word - regs.semaphore_sequence) > 0) || | 293 | static_cast<s32>(word - regs.semaphore_sequence) > 0) || |
| @@ -317,13 +314,11 @@ void GPU::ProcessSemaphoreTriggerMethod() { | |||
| 317 | } | 314 | } |
| 318 | 315 | ||
| 319 | void GPU::ProcessSemaphoreRelease() { | 316 | void GPU::ProcessSemaphoreRelease() { |
| 320 | const auto address = memory_manager->GpuToCpuAddress(regs.smaphore_address.SmaphoreAddress()); | 317 | memory_manager->Write32(regs.smaphore_address.SmaphoreAddress(), regs.semaphore_release); |
| 321 | Memory::Write32(*address, regs.semaphore_release); | ||
| 322 | } | 318 | } |
| 323 | 319 | ||
| 324 | void GPU::ProcessSemaphoreAcquire() { | 320 | void GPU::ProcessSemaphoreAcquire() { |
| 325 | const auto address = memory_manager->GpuToCpuAddress(regs.smaphore_address.SmaphoreAddress()); | 321 | const u32 word = memory_manager->Read32(regs.smaphore_address.SmaphoreAddress()); |
| 326 | const u32 word = Memory::Read32(*address); | ||
| 327 | const auto value = regs.semaphore_acquire; | 322 | const auto value = regs.semaphore_acquire; |
| 328 | if (word != value) { | 323 | if (word != value) { |
| 329 | regs.acquire_active = true; | 324 | regs.acquire_active = true; |