Support for resources on non-contiguous GPU memory regions (#1905)
* Support for resources on non-contiguous GPU memory regions * Implement MultiRange physical addresses, only used with a single range for now * Actually use non-contiguous ranges * GetPhysicalRegions fixes * Documentation and remove Address property from TextureInfo * Finish implementing GetWritableRegion * Fix typo
This commit is contained in:
parent
3bad321d2b
commit
c4f56c5704
18 changed files with 1141 additions and 167 deletions
|
@ -4,16 +4,16 @@ namespace Ryujinx.Memory
|
|||
{
|
||||
public sealed class WritableRegion : IDisposable
|
||||
{
|
||||
private readonly IVirtualMemoryManager _mm;
|
||||
private readonly IWritableBlock _block;
|
||||
private readonly ulong _va;
|
||||
|
||||
private bool NeedsWriteback => _mm != null;
|
||||
private bool NeedsWriteback => _block != null;
|
||||
|
||||
public Memory<byte> Memory { get; }
|
||||
|
||||
public WritableRegion(IVirtualMemoryManager mm, ulong va, Memory<byte> memory)
|
||||
public WritableRegion(IWritableBlock block, ulong va, Memory<byte> memory)
|
||||
{
|
||||
_mm = mm;
|
||||
_block = block;
|
||||
_va = va;
|
||||
Memory = memory;
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ namespace Ryujinx.Memory
|
|||
{
|
||||
if (NeedsWriteback)
|
||||
{
|
||||
_mm.Write(_va, Memory.Span);
|
||||
_block.Write(_va, Memory.Span);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue