From 04dce402ac94679c5439038be1c8ce090e7ad4cb Mon Sep 17 00:00:00 2001 From: gdkchan Date: Mon, 12 Jul 2021 16:48:57 -0300 Subject: Implement a fast path for I2M transfers (#2467) --- .../Engine/InlineToMemory/InlineToMemoryClass.cs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'Ryujinx.Graphics.Gpu/Engine/InlineToMemory/InlineToMemoryClass.cs') diff --git a/Ryujinx.Graphics.Gpu/Engine/InlineToMemory/InlineToMemoryClass.cs b/Ryujinx.Graphics.Gpu/Engine/InlineToMemory/InlineToMemoryClass.cs index cb4133ec..186a4648 100644 --- a/Ryujinx.Graphics.Gpu/Engine/InlineToMemory/InlineToMemoryClass.cs +++ b/Ryujinx.Graphics.Gpu/Engine/InlineToMemory/InlineToMemoryClass.cs @@ -127,6 +127,26 @@ namespace Ryujinx.Graphics.Gpu.Engine.InlineToMemory _finished = false; } + /// + /// Pushes a block of data to the Inline-to-Memory engine. + /// + /// Data to push + public void LoadInlineData(ReadOnlySpan data) + { + if (!_finished) + { + int copySize = Math.Min(data.Length, _buffer.Length - _offset); + data.Slice(0, copySize).CopyTo(new Span(_buffer).Slice(_offset, copySize)); + + _offset += copySize; + + if (_offset * 4 >= _size) + { + FinishTransfer(); + } + } + } + /// /// Pushes a word of data to the Inline-to-Memory engine. /// -- cgit v1.2.3