/ src / Ryujinx.Graphics.Gpu / Shader / HashTable / IDataAccessor.cs
IDataAccessor.cs
 1  using System;
 2  
 3  namespace Ryujinx.Graphics.Gpu.Shader.HashTable
 4  {
 5      /// <summary>
 6      /// Data accessor, used by <see cref="PartitionedHashTable{T}"/> to access data of unknown length.
 7      /// </summary>
 8      /// <remarks>
 9      /// This will be used to access chuncks of data and try finding a match on the table.
10      /// This is necessary because the data size is assumed to be unknown, and so the
11      /// hash table must try to "guess" the size of the data based on the entries on the table.
12      /// </remarks>
13      public interface IDataAccessor
14      {
15          /// <summary>
16          /// Gets a span of shader code at the specified offset, with at most the specified size.
17          /// </summary>
18          /// <remarks>
19          /// This might return a span smaller than the requested <paramref name="length"/> if there's
20          /// no more code available.
21          /// </remarks>
22          /// <param name="offset">Offset in shader code</param>
23          /// <param name="length">Size in bytes</param>
24          /// <returns>Shader code span</returns>
25          ReadOnlySpan<byte> GetSpan(int offset, int length);
26      }
27  }