aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Texture/LayoutConverter.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.Graphics.Texture/LayoutConverter.cs')
-rw-r--r--Ryujinx.Graphics.Texture/LayoutConverter.cs9
1 files changed, 7 insertions, 2 deletions
diff --git a/Ryujinx.Graphics.Texture/LayoutConverter.cs b/Ryujinx.Graphics.Texture/LayoutConverter.cs
index fb25541b..1b7dad2a 100644
--- a/Ryujinx.Graphics.Texture/LayoutConverter.cs
+++ b/Ryujinx.Graphics.Texture/LayoutConverter.cs
@@ -358,7 +358,7 @@ namespace Ryujinx.Graphics.Texture
};
}
- public static Span<byte> ConvertLinearToBlockLinear(
+ public static ReadOnlySpan<byte> ConvertLinearToBlockLinear(
int width,
int height,
int depth,
@@ -499,7 +499,7 @@ namespace Ryujinx.Graphics.Texture
return output;
}
- public static Span<byte> ConvertLinearToLinearStrided(
+ public static ReadOnlySpan<byte> ConvertLinearToLinearStrided(
int width,
int height,
int blockWidth,
@@ -514,6 +514,11 @@ namespace Ryujinx.Graphics.Texture
int inStride = BitUtils.AlignUp(w * bytesPerPixel, HostStrideAlignment);
int lineSize = width * bytesPerPixel;
+ if (inStride == stride)
+ {
+ return data;
+ }
+
Span<byte> output = new byte[h * stride];
int inOffs = 0;