diff options
Diffstat (limited to 'Ryujinx.Graphics.Texture')
| -rw-r--r-- | Ryujinx.Graphics.Texture/OffsetCalculator.cs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Ryujinx.Graphics.Texture/OffsetCalculator.cs b/Ryujinx.Graphics.Texture/OffsetCalculator.cs index dd4b6e7f..d7472e2f 100644 --- a/Ryujinx.Graphics.Texture/OffsetCalculator.cs +++ b/Ryujinx.Graphics.Texture/OffsetCalculator.cs @@ -1,4 +1,5 @@ using Ryujinx.Common; +using System; using System.Runtime.CompilerServices; using static Ryujinx.Graphics.Texture.BlockLinearConstants; @@ -111,9 +112,9 @@ namespace Ryujinx.Graphics.Texture { if (_isLinear) { - int start = y * _stride + x * _bytesPerPixel; - int end = (y + height - 1) * _stride + (x + width) * _bytesPerPixel; - return (start, end - start); + int start = y * Math.Abs(_stride) + x * _bytesPerPixel; + int end = (y + height - 1) * Math.Abs(_stride) + (x + width) * _bytesPerPixel; + return (y * _stride + x * _bytesPerPixel, end - start); } else { |
