Flush buffers on copies
This commit is contained in:
parent
8cba252b23
commit
f2e84ff566
3 changed files with 28 additions and 21 deletions
|
@ -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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue