/ src / Ryujinx.Graphics.Gpu / Memory / BufferCacheEntry.cs
BufferCacheEntry.cs
 1  namespace Ryujinx.Graphics.Gpu.Memory
 2  {
 3      /// <summary>
 4      /// A cached entry for easily locating a buffer that is used often internally.
 5      /// </summary>
 6      class BufferCacheEntry
 7      {
 8          /// <summary>
 9          /// The CPU VA of the buffer destination.
10          /// </summary>
11          public ulong Address;
12  
13          /// <summary>
14          /// The end GPU VA of the associated buffer, used to check if new data can fit.
15          /// </summary>
16          public ulong EndGpuAddress;
17  
18          /// <summary>
19          /// The buffer associated with this cache entry.
20          /// </summary>
21          public Buffer Buffer;
22  
23          /// <summary>
24          /// The UnmappedSequence of the buffer at the time of creation.
25          /// If this differs from the value currently in the buffer, then this cache entry is outdated.
26          /// </summary>
27          public int UnmappedSequence;
28  
29          /// <summary>
30          /// Create a new cache entry.
31          /// </summary>
32          /// <param name="address">The CPU VA of the buffer destination</param>
33          /// <param name="gpuVa">The GPU VA of the buffer destination</param>
34          /// <param name="buffer">The buffer object containing the target buffer</param>
35          public BufferCacheEntry(ulong address, ulong gpuVa, Buffer buffer)
36          {
37              Address = address;
38              EndGpuAddress = gpuVa + (buffer.EndAddress - address);
39              Buffer = buffer;
40              UnmappedSequence = buffer.UnmappedSequence;
41          }
42      }
43  }