aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/Memory/Buffer.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Memory/Buffer.cs')
-rw-r--r--Ryujinx.Graphics.Gpu/Memory/Buffer.cs11
1 files changed, 11 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.Gpu/Memory/Buffer.cs b/Ryujinx.Graphics.Gpu/Memory/Buffer.cs
index 6f904d0f..e37fbc0f 100644
--- a/Ryujinx.Graphics.Gpu/Memory/Buffer.cs
+++ b/Ryujinx.Graphics.Gpu/Memory/Buffer.cs
@@ -9,6 +9,8 @@ namespace Ryujinx.Graphics.Gpu.Memory
private IBuffer _buffer;
+ public IBuffer HostBuffer => _buffer;
+
public ulong Address { get; }
public ulong Size { get; }
@@ -86,6 +88,15 @@ namespace Ryujinx.Graphics.Gpu.Memory
_buffer.CopyTo(destination._buffer, 0, dstOffset, (int)Size);
}
+ public void Flush(ulong address, ulong size)
+ {
+ int offset = (int)(address - Address);
+
+ byte[] data = _buffer.GetData(offset, (int)size);
+
+ _context.PhysicalMemory.Write(address, data);
+ }
+
public void Invalidate()
{
_buffer.SetData(0, _context.PhysicalMemory.Read(Address, Size));