namespace Ryujinx.Graphics.Gpu.Memory
{
///
/// A cached entry for easily locating a buffer that is used often internally.
///
class BufferCacheEntry
{
///
/// The CPU VA of the buffer destination.
///
public ulong Address;
///
/// The end GPU VA of the associated buffer, used to check if new data can fit.
///
public ulong EndGpuAddress;
///
/// The buffer associated with this cache entry.
///
public Buffer Buffer;
///
/// The UnmappedSequence of the buffer at the time of creation.
/// If this differs from the value currently in the buffer, then this cache entry is outdated.
///
public int UnmappedSequence;
///
/// Create a new cache entry.
///
/// The CPU VA of the buffer destination
/// The GPU VA of the buffer destination
/// The buffer object containing the target buffer
public BufferCacheEntry(ulong address, ulong gpuVa, Buffer buffer)
{
Address = address;
EndGpuAddress = gpuVa + (buffer.EndAddress - address);
Buffer = buffer;
UnmappedSequence = buffer.UnmappedSequence;
}
}
}