IDataAccessor.cs 1.1 KB

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