diff options
Diffstat (limited to 'src/Ryujinx.Graphics.Texture/SizeCalculator.cs')
-rw-r--r-- | src/Ryujinx.Graphics.Texture/SizeCalculator.cs | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/Ryujinx.Graphics.Texture/SizeCalculator.cs b/src/Ryujinx.Graphics.Texture/SizeCalculator.cs index 0120bd7a..7fe89e7e 100644 --- a/src/Ryujinx.Graphics.Texture/SizeCalculator.cs +++ b/src/Ryujinx.Graphics.Texture/SizeCalculator.cs @@ -1,6 +1,5 @@ using Ryujinx.Common; using System; - using static Ryujinx.Graphics.Texture.BlockLinearConstants; namespace Ryujinx.Graphics.Texture @@ -48,16 +47,16 @@ namespace Ryujinx.Graphics.Texture int mipGobBlocksInY = gobBlocksInY; int mipGobBlocksInZ = gobBlocksInZ; - int gobWidth = (GobStride / bytesPerPixel) * gobBlocksInTileX; + int gobWidth = (GobStride / bytesPerPixel) * gobBlocksInTileX; int gobHeight = gobBlocksInY * GobHeight; int depthLevelOffset = 0; for (int level = 0; level < levels; level++) { - int w = Math.Max(1, width >> level); + int w = Math.Max(1, width >> level); int h = Math.Max(1, height >> level); - int d = Math.Max(1, depth >> level); + int d = Math.Max(1, depth >> level); w = BitUtils.DivRoundUp(w, blockWidth); h = BitUtils.DivRoundUp(h, blockHeight); @@ -104,7 +103,7 @@ namespace Ryujinx.Graphics.Texture for (int z = 0; z < d; z++) { - int zLow = z & mask; + int zLow = z & mask; int zHigh = z & ~mask; allOffsets[z + depthLevelOffset] = baseOffset + zLow * gobSize + zHigh * sliceSize; @@ -159,7 +158,7 @@ namespace Ryujinx.Graphics.Texture { for (int layer = 0; layer < layers; layer++) { - int baseIndex = layer * levels; + int baseIndex = layer * levels; int baseOffset = layer * layerSize; for (int level = 0; level < levels; level++) @@ -234,10 +233,10 @@ namespace Ryujinx.Graphics.Texture int gobBlocksInZ, int gobBlocksInTileX) { - width = BitUtils.DivRoundUp(width, blockWidth); + width = BitUtils.DivRoundUp(width, blockWidth); height = BitUtils.DivRoundUp(height, blockHeight); - int gobWidth = (GobStride / bytesPerPixel) * gobBlocksInTileX; + int gobWidth = (GobStride / bytesPerPixel) * gobBlocksInTileX; int gobHeight = gobBlocksInY * GobHeight; int alignment = gobWidth; @@ -251,11 +250,11 @@ namespace Ryujinx.Graphics.Texture (gobBlocksInY, gobBlocksInZ) = GetMipGobBlockSizes(height, depth, 1, gobBlocksInY, gobBlocksInZ); int blockOfGobsHeight = gobBlocksInY * GobHeight; - int blockOfGobsDepth = gobBlocksInZ; + int blockOfGobsDepth = gobBlocksInZ; - width = BitUtils.AlignUp(width, alignment); + width = BitUtils.AlignUp(width, alignment); height = BitUtils.AlignUp(height, blockOfGobsHeight); - depth = BitUtils.AlignUp(depth, blockOfGobsDepth); + depth = BitUtils.AlignUp(depth, blockOfGobsDepth); return new Size(width, height, depth); } @@ -267,7 +266,7 @@ namespace Ryujinx.Graphics.Texture int blockHeight, int bytesPerPixel) { - width = BitUtils.DivRoundUp(width, blockWidth); + width = BitUtils.DivRoundUp(width, blockWidth); height = BitUtils.DivRoundUp(height, blockHeight); int widthAlignment = StrideAlignment / bytesPerPixel; @@ -300,4 +299,4 @@ namespace Ryujinx.Graphics.Texture return (gobBlocksInY, gobBlocksInZ); } } -}
\ No newline at end of file +} |