From ca5ac37cd638222e7475ac8f632b878126f3462d Mon Sep 17 00:00:00 2001 From: riperiperi Date: Fri, 16 Jul 2021 22:10:20 +0100 Subject: Flush buffers and texture data through a persistent mapped buffer. (#2481) * Use persistent buffers to flush texture data * Flush buffers via copy to persistent buffers. * Log error when timing out, small refactoring. --- Ryujinx.Graphics.Texture/LayoutConverter.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'Ryujinx.Graphics.Texture') 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 ConvertLinearToBlockLinear( + public static ReadOnlySpan ConvertLinearToBlockLinear( int width, int height, int depth, @@ -499,7 +499,7 @@ namespace Ryujinx.Graphics.Texture return output; } - public static Span ConvertLinearToLinearStrided( + public static ReadOnlySpan 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 output = new byte[h * stride]; int inOffs = 0; -- cgit v1.2.3