Implement a fast path for I2M transfers (#2467)

This commit is contained in:
gdkchan 2021-07-12 16:48:57 -03:00 committed by GitHub
parent 9b08abc644
commit 04dce402ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 88 additions and 3 deletions

View file

@ -127,6 +127,26 @@ namespace Ryujinx.Graphics.Gpu.Engine.InlineToMemory
_finished = false;
}
/// <summary>
/// Pushes a block of data to the Inline-to-Memory engine.
/// </summary>
/// <param name="data">Data to push</param>
public void LoadInlineData(ReadOnlySpan<int> data)
{
if (!_finished)
{
int copySize = Math.Min(data.Length, _buffer.Length - _offset);
data.Slice(0, copySize).CopyTo(new Span<int>(_buffer).Slice(_offset, copySize));
_offset += copySize;
if (_offset * 4 >= _size)
{
FinishTransfer();
}
}
}
/// <summary>
/// Pushes a word of data to the Inline-to-Memory engine.
/// </summary>