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