Просмотр исходного кода

Fix DMA copy fast path line size when xCount < stride (#2942)

gdkchan 4 лет назад
Родитель
Сommit
a87f7f2029

+ 1 - 0
Ryujinx.Graphics.Gpu/Engine/Dma/DmaClass.cs

@@ -222,6 +222,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Dma
                                 target.Info.Height,
                                 1,
                                 1,
+                                xCount * srcBpp,
                                 srcStride,
                                 target.Info.FormatInfo.BytesPerPixel,
                                 srcSpan);

+ 1 - 0
Ryujinx.Graphics.Gpu/Image/Texture.cs

@@ -760,6 +760,7 @@ namespace Ryujinx.Graphics.Gpu.Image
                     Info.FormatInfo.BlockWidth,
                     Info.FormatInfo.BlockHeight,
                     Info.Stride,
+                    Info.Stride,
                     Info.FormatInfo.BytesPerPixel,
                     data);
             }

+ 2 - 1
Ryujinx.Graphics.Texture/LayoutConverter.cs

@@ -248,6 +248,7 @@ namespace Ryujinx.Graphics.Texture
             int height,
             int blockWidth,
             int blockHeight,
+            int lineSize,
             int stride,
             int bytesPerPixel,
             ReadOnlySpan<byte> data)
@@ -256,7 +257,7 @@ namespace Ryujinx.Graphics.Texture
             int h = BitUtils.DivRoundUp(height, blockHeight);
 
             int outStride = BitUtils.AlignUp(w * bytesPerPixel, HostStrideAlignment);
-            int lineSize = Math.Min(stride, outStride);
+            lineSize = Math.Min(lineSize, outStride);
 
             Span<byte> output = new byte[h * outStride];