diff options
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Memory/PhysicalMemory.cs')
-rw-r--r-- | Ryujinx.Graphics.Gpu/Memory/PhysicalMemory.cs | 33 |
1 files changed, 11 insertions, 22 deletions
diff --git a/Ryujinx.Graphics.Gpu/Memory/PhysicalMemory.cs b/Ryujinx.Graphics.Gpu/Memory/PhysicalMemory.cs index 0ec41a8f..d292fab0 100644 --- a/Ryujinx.Graphics.Gpu/Memory/PhysicalMemory.cs +++ b/Ryujinx.Graphics.Gpu/Memory/PhysicalMemory.cs @@ -81,28 +81,6 @@ namespace Ryujinx.Graphics.Gpu.Memory } /// <summary> - /// Write data to memory that is destined for a resource in a cache. - /// This avoids triggering write tracking when possible, which can avoid flushes and incrementing sequence number. - /// </summary> - /// <param name="memoryManager">The GPU memory manager</param> - /// <param name="gpuVa">GPU virtual address to write the data into</param> - /// <param name="data">The data to be written</param> - public void CacheResourceWrite(MemoryManager memoryManager, ulong gpuVa, ReadOnlySpan<byte> data) - { - if (TextureCache.IsTextureInRange(memoryManager, gpuVa, (ulong)data.Length)) - { - // No fast path yet - copy the data back and trigger write tracking. - memoryManager.Write(gpuVa, data); - _context.AdvanceSequence(); - } - else - { - BufferCache.ForceDirty(memoryManager, gpuVa, (ulong)data.Length); - memoryManager.WriteUntracked(gpuVa, data); - } - } - - /// <summary> /// Gets a span of data from the application process. /// </summary> /// <param name="address">Start address of the range</param> @@ -180,6 +158,17 @@ namespace Ryujinx.Graphics.Gpu.Memory } /// <summary> + /// Writes data to the application process, triggering a precise memory tracking event. + /// </summary> + /// <param name="address">Address to write into</param> + /// <param name="data">Data to be written</param> + public void WriteTrackedResource(ulong address, ReadOnlySpan<byte> data) + { + _cpuMemory.SignalMemoryTracking(address, (ulong)data.Length, true, precise: true); + _cpuMemory.WriteUntracked(address, data); + } + + /// <summary> /// Writes data to the application process. /// </summary> /// <param name="address">Address to write into</param> |