mirror of
https://github.com/ryujinx-mirror/ryujinx.git
synced 2024-12-22 22:36:25 +00:00
c4f56c5704
* 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
30 lines
639 B
C#
30 lines
639 B
C#
using System;
|
|
|
|
namespace Ryujinx.Memory
|
|
{
|
|
public sealed class WritableRegion : IDisposable
|
|
{
|
|
private readonly IWritableBlock _block;
|
|
private readonly ulong _va;
|
|
|
|
private bool NeedsWriteback => _block != null;
|
|
|
|
public Memory<byte> Memory { get; }
|
|
|
|
public WritableRegion(IWritableBlock block, ulong va, Memory<byte> memory)
|
|
{
|
|
_block = block;
|
|
_va = va;
|
|
Memory = memory;
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
if (NeedsWriteback)
|
|
{
|
|
_block.Write(_va, Memory.Span);
|
|
}
|
|
}
|
|
}
|
|
}
|