Initialize GPU physical memory accessor from KProcess, to allow homebrew that never maps anything on the GPU to work
This commit is contained in:
parent
6cf9a04d98
commit
647d0962df
7 changed files with 40 additions and 61 deletions
31
Ryujinx.Graphics.Gpu/Memory/PhysicalMemory.cs
Normal file
31
Ryujinx.Graphics.Gpu/Memory/PhysicalMemory.cs
Normal file
|
@ -0,0 +1,31 @@
|
|||
using System;
|
||||
|
||||
namespace Ryujinx.Graphics.Gpu.Memory
|
||||
{
|
||||
using CpuMemoryManager = ARMeilleure.Memory.MemoryManager;
|
||||
|
||||
class PhysicalMemory
|
||||
{
|
||||
private readonly CpuMemoryManager _cpuMemory;
|
||||
|
||||
public PhysicalMemory(CpuMemoryManager cpuMemory)
|
||||
{
|
||||
_cpuMemory = cpuMemory;
|
||||
}
|
||||
|
||||
public Span<byte> Read(ulong address, ulong size)
|
||||
{
|
||||
return _cpuMemory.ReadBytes((long)address, (long)size);
|
||||
}
|
||||
|
||||
public void Write(ulong address, Span<byte> data)
|
||||
{
|
||||
_cpuMemory.WriteBytes((long)address, data.ToArray());
|
||||
}
|
||||
|
||||
public (ulong, ulong)[] GetModifiedRanges(ulong address, ulong size, ResourceName name)
|
||||
{
|
||||
return _cpuMemory.GetModifiedRanges(address, size, (int)name);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue