aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Memory/IVirtualMemoryManager.cs
diff options
context:
space:
mode:
authorriperiperi <rhy3756547@hotmail.com>2022-11-24 14:50:15 +0000
committerGitHub <noreply@github.com>2022-11-24 15:50:15 +0100
commit65778a6b78ab8bde4090478482227e40c551db4d (patch)
tree3f59d3060b635a0cd9f9d87057ef12c00731f2ee /Ryujinx.Memory/IVirtualMemoryManager.cs
parentf4e879a1e6ad810aa38c1c020467a2589441871b (diff)
GPU: Don't trigger uploads for redundant buffer updates (#3828)1.1.382
* Initial implementation * Actually do The Thing * Add remark about performance to IVirtualMemoryManager
Diffstat (limited to 'Ryujinx.Memory/IVirtualMemoryManager.cs')
-rw-r--r--Ryujinx.Memory/IVirtualMemoryManager.cs11
1 files changed, 11 insertions, 0 deletions
diff --git a/Ryujinx.Memory/IVirtualMemoryManager.cs b/Ryujinx.Memory/IVirtualMemoryManager.cs
index f97cb0b5..c8a74f66 100644
--- a/Ryujinx.Memory/IVirtualMemoryManager.cs
+++ b/Ryujinx.Memory/IVirtualMemoryManager.cs
@@ -58,6 +58,17 @@ namespace Ryujinx.Memory
/// <exception cref="InvalidMemoryRegionException">Throw for unhandled invalid or unmapped memory accesses</exception>
void Write(ulong va, ReadOnlySpan<byte> data);
+ /// <summary>
+ /// Writes data to the application process, returning false if the data was not changed.
+ /// This triggers read memory tracking, as a redundancy check would be useless if the data is not up to date.
+ /// </summary>
+ /// <remarks>The memory manager can return that memory has changed when it hasn't to avoid expensive data copies.</remarks>
+ /// <param name="va">Virtual address to write the data into</param>
+ /// <param name="data">Data to be written</param>
+ /// <exception cref="InvalidMemoryRegionException">Throw for unhandled invalid or unmapped memory accesses</exception>
+ /// <returns>True if the data was changed, false otherwise</returns>
+ bool WriteWithRedundancyCheck(ulong va, ReadOnlySpan<byte> data);
+
void Fill(ulong va, ulong size, byte value)
{
const int MaxChunkSize = 1 << 24;