From 1876b346fea647e8284a66bb6d62c38801035cff Mon Sep 17 00:00:00 2001 From: gdk Date: Sun, 13 Oct 2019 03:02:07 -0300 Subject: Initial work --- Ryujinx.Graphics.Gpu/Engine/Inline2Memory.cs | 42 ++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 Ryujinx.Graphics.Gpu/Engine/Inline2Memory.cs (limited to 'Ryujinx.Graphics.Gpu/Engine/Inline2Memory.cs') diff --git a/Ryujinx.Graphics.Gpu/Engine/Inline2Memory.cs b/Ryujinx.Graphics.Gpu/Engine/Inline2Memory.cs new file mode 100644 index 00000000..d2816ac5 --- /dev/null +++ b/Ryujinx.Graphics.Gpu/Engine/Inline2Memory.cs @@ -0,0 +1,42 @@ +using Ryujinx.Graphics.Gpu.State; +using System; + +namespace Ryujinx.Graphics.Gpu.Engine +{ + partial class Methods + { + private Inline2MemoryParams _params; + + private bool _isLinear; + + private int _offset; + private int _size; + + public void Execute(int argument) + { + _params = _context.State.Get(MethodOffset.Inline2MemoryParams); + + _isLinear = (argument & 1) != 0; + + _offset = 0; + _size = _params.LineLengthIn * _params.LineCount; + } + + public void PushData(int argument) + { + if (_isLinear) + { + for (int shift = 0; shift < 32 && _offset < _size; shift += 8, _offset++) + { + ulong gpuVa = _params.DstAddress.Pack() + (ulong)_offset; + + _context.MemoryAccessor.Write(gpuVa, new byte[] { (byte)(argument >> shift) }); + } + } + else + { + throw new NotImplementedException(); + } + } + } +} \ No newline at end of file -- cgit v1.2.3