aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/Engine/Inline2Memory.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Engine/Inline2Memory.cs')
-rw-r--r--Ryujinx.Graphics.Gpu/Engine/Inline2Memory.cs19
1 files changed, 10 insertions, 9 deletions
diff --git a/Ryujinx.Graphics.Gpu/Engine/Inline2Memory.cs b/Ryujinx.Graphics.Gpu/Engine/Inline2Memory.cs
index a31ec72a..3d23b785 100644
--- a/Ryujinx.Graphics.Gpu/Engine/Inline2Memory.cs
+++ b/Ryujinx.Graphics.Gpu/Engine/Inline2Memory.cs
@@ -40,10 +40,10 @@ namespace Ryujinx.Graphics.Gpu.Engine
_buffer = new int[count];
}
- ulong dstBaseAddress = _context.MemoryManager.Translate(_params.DstAddress.Pack());
+ ulong dstBaseAddress = state.Channel.MemoryManager.Translate(_params.DstAddress.Pack());
// Trigger read tracking, to flush any managed resources in the destination region.
- _context.PhysicalMemory.GetSpan(dstBaseAddress, _size, true);
+ state.Channel.MemoryManager.Physical.GetSpan(dstBaseAddress, _size, true);
_finished = false;
}
@@ -61,7 +61,7 @@ namespace Ryujinx.Graphics.Gpu.Engine
if (_offset * 4 >= _size)
{
- FinishTransfer();
+ FinishTransfer(state);
}
}
}
@@ -69,15 +69,16 @@ namespace Ryujinx.Graphics.Gpu.Engine
/// <summary>
/// Performs actual copy of the inline data after the transfer is finished.
/// </summary>
- private void FinishTransfer()
+ /// <param name="state">Current GPU state</param>
+ private void FinishTransfer(GpuState state)
{
Span<byte> data = MemoryMarshal.Cast<int, byte>(_buffer).Slice(0, _size);
if (_isLinear && _params.LineCount == 1)
{
- ulong address = _context.MemoryManager.Translate(_params.DstAddress.Pack());
+ ulong address = state.Channel.MemoryManager.Translate(_params.DstAddress.Pack());
- _context.PhysicalMemory.Write(address, data);
+ state.Channel.MemoryManager.Physical.Write(address, data);
}
else
{
@@ -91,7 +92,7 @@ namespace Ryujinx.Graphics.Gpu.Engine
int srcOffset = 0;
- ulong dstBaseAddress = _context.MemoryManager.Translate(_params.DstAddress.Pack());
+ ulong dstBaseAddress = state.Channel.MemoryManager.Translate(_params.DstAddress.Pack());
for (int y = _params.DstY; y < _params.DstY + _params.LineCount; y++)
{
@@ -109,7 +110,7 @@ namespace Ryujinx.Graphics.Gpu.Engine
Span<byte> pixel = data.Slice(srcOffset, 16);
- _context.PhysicalMemory.Write(dstAddress, pixel);
+ state.Channel.MemoryManager.Physical.Write(dstAddress, pixel);
}
for (; x < x2; x++, srcOffset++)
@@ -120,7 +121,7 @@ namespace Ryujinx.Graphics.Gpu.Engine
Span<byte> pixel = data.Slice(srcOffset, 1);
- _context.PhysicalMemory.Write(dstAddress, pixel);
+ state.Channel.MemoryManager.Physical.Write(dstAddress, pixel);
}
}
}