1
0
Fork 0
mirror of https://github.com/Ryujinx/Ryujinx.git synced 2024-10-01 12:30:00 +02:00
Ryujinx/Ryujinx.Graphics.Gpu/Engine/Inline2Memory.cs

42 lines
1.1 KiB
C#
Raw Normal View History

2019-10-13 08:02:07 +02:00
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<Inline2MemoryParams>(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();
}
}
}
}