EndPointSet.cs 615 B

1234567891011121314151617181920212223
  1. using System;
  2. using System.Diagnostics;
  3. using System.Runtime.CompilerServices;
  4. using System.Runtime.InteropServices;
  5. namespace Ryujinx.Graphics.Texture.Astc
  6. {
  7. [StructLayout(LayoutKind.Sequential, Size = AstcPixel.StructSize * 8)]
  8. internal struct EndPointSet
  9. {
  10. private AstcPixel _start;
  11. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  12. public Span<AstcPixel> Get(int index)
  13. {
  14. Debug.Assert(index < 4);
  15. ref AstcPixel start = ref Unsafe.Add(ref _start, index * 2);
  16. return MemoryMarshal.CreateSpan(ref start, 2);
  17. }
  18. }
  19. }