From fbb4019ed5c12c4a888c7b09db648ac595366896 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Tue, 29 Jun 2021 14:32:02 -0300 Subject: Initial support for separate GPU address spaces (#2394) * Make GPU memory manager a member of GPU channel * Move physical memory instance to the memory manager, and the caches to the physical memory * PR feedback --- Ryujinx.Graphics.Gpu/Engine/GPFifo/GPFifoDevice.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'Ryujinx.Graphics.Gpu/Engine/GPFifo/GPFifoDevice.cs') diff --git a/Ryujinx.Graphics.Gpu/Engine/GPFifo/GPFifoDevice.cs b/Ryujinx.Graphics.Gpu/Engine/GPFifo/GPFifoDevice.cs index 0e284ac5..ada3bc4b 100644 --- a/Ryujinx.Graphics.Gpu/Engine/GPFifo/GPFifoDevice.cs +++ b/Ryujinx.Graphics.Gpu/Engine/GPFifo/GPFifoDevice.cs @@ -1,4 +1,5 @@ -using System; +using Ryujinx.Graphics.Gpu.Memory; +using System; using System.Collections.Concurrent; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -53,11 +54,11 @@ namespace Ryujinx.Graphics.Gpu.Engine.GPFifo /// /// Fetch the command buffer. /// - public void Fetch(GpuContext context) + public void Fetch(MemoryManager memoryManager) { if (Words == null) { - Words = MemoryMarshal.Cast(context.MemoryManager.GetSpan(EntryAddress, (int)EntryCount * 4, true)).ToArray(); + Words = MemoryMarshal.Cast(memoryManager.GetSpan(EntryAddress, (int)EntryCount * 4, true)).ToArray(); } } } @@ -155,7 +156,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.GPFifo if (beforeBarrier && commandBuffer.Type == CommandBufferType.Prefetch) { - commandBuffer.Fetch(_context); + commandBuffer.Fetch(processor.MemoryManager); } if (commandBuffer.Type == CommandBufferType.NoPrefetch) @@ -182,13 +183,13 @@ namespace Ryujinx.Graphics.Gpu.Engine.GPFifo public void DispatchCalls() { // Use this opportunity to also dispose any pending channels that were closed. - _context.DisposePendingChannels(); + _context.RunDeferredActions(); // Process command buffers. while (_ibEnable && !_interrupt && _commandBufferQueue.TryDequeue(out CommandBuffer entry)) { _currentCommandBuffer = entry; - _currentCommandBuffer.Fetch(_context); + _currentCommandBuffer.Fetch(entry.Processor.MemoryManager); // If we are changing the current channel, // we need to force all the host state to be updated. -- cgit v1.2.3