namespace Dashboard.Drawing { public enum BufferAccessPattern { /// /// No hint given. Not recommended. /// DontCare, /// /// For buffers which have a long lifetime, but the contents are initialized once. /// Static, /// /// For buffers which have a long lifetime, but the contents can be updated every frame. /// Stream, /// /// For buffers which have a short lifetime, used for streaming resources to the graphics hardware. /// Upload, /// /// For buffers which have a short lifetime, used for streaming resources from the graphics hardware. /// Download, } public interface IBuffer : IDisposable { public BufferAccessPattern AccessPattern { get; } public long Size { get; } void Reallocate(long newSize); Span Map(long offset, int count = -1) where T : unmanaged; void Unmap(); void Read(long offset, Span span) where T : unmanaged; void Write(long offset, ReadOnlySpan span) where T : unmanaged; } }