diff options
Diffstat (limited to 'Ryujinx.Graphics.Texture/SizeInfo.cs')
-rw-r--r-- | Ryujinx.Graphics.Texture/SizeInfo.cs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.Texture/SizeInfo.cs b/Ryujinx.Graphics.Texture/SizeInfo.cs index f518ee4b..880d677b 100644 --- a/Ryujinx.Graphics.Texture/SizeInfo.cs +++ b/Ryujinx.Graphics.Texture/SizeInfo.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; namespace Ryujinx.Graphics.Texture { @@ -91,5 +92,23 @@ namespace Ryujinx.Graphics.Texture return true; } + + public IEnumerable<Region> AllRegions() + { + if (_is3D) + { + for (int i = 0; i < _mipOffsets.Length; i++) + { + yield return new Region(_mipOffsets[i], SliceSizes[i]); + } + } + else + { + for (int i = 0; i < AllOffsets.Length; i++) + { + yield return new Region(AllOffsets[i], SliceSizes[i % _levels]); + } + } + } } }
\ No newline at end of file |