diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2020-04-25 10:02:18 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-25 23:02:18 +1000 |
| commit | 3cb1fa0e853efc04cc183d3ee75ec1bbe2c845a4 (patch) | |
| tree | cf19d371b99cffdbff03e2f20271927cb7b08bf8 /Ryujinx.Graphics.Texture | |
| parent | a065dc1626d2fa4cb5c7300a1aa8713ffb4f5896 (diff) | |
Implement texture buffers (#1152)
* Implement texture buffers
* Throw NotSupportedException where appropriate
Diffstat (limited to 'Ryujinx.Graphics.Texture')
| -rw-r--r-- | Ryujinx.Graphics.Texture/SizeInfo.cs | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/Ryujinx.Graphics.Texture/SizeInfo.cs b/Ryujinx.Graphics.Texture/SizeInfo.cs index 37d824cc..b6085e0c 100644 --- a/Ryujinx.Graphics.Texture/SizeInfo.cs +++ b/Ryujinx.Graphics.Texture/SizeInfo.cs @@ -1,19 +1,27 @@ -using Ryujinx.Common; using System; namespace Ryujinx.Graphics.Texture { public struct SizeInfo { - private int[] _mipOffsets; - private int[] _allOffsets; + private readonly int[] _mipOffsets; + private readonly int[] _allOffsets; - private int _levels; + private readonly int _levels; public int LayerSize { get; } public int TotalSize { get; } - public SizeInfo( + public SizeInfo(int size) + { + _mipOffsets = new int[] { 0 }; + _allOffsets = new int[] { 0 }; + _levels = 1; + LayerSize = size; + TotalSize = size; + } + + internal SizeInfo( int[] mipOffsets, int[] allOffsets, int levels, @@ -29,7 +37,7 @@ namespace Ryujinx.Graphics.Texture public int GetMipOffset(int level) { - if ((uint)level > _mipOffsets.Length) + if ((uint)level >= _mipOffsets.Length) { throw new ArgumentOutOfRangeException(nameof(level)); } |
