From 9c1e9a40347590c2d22088aa52da2971fc7b18cc Mon Sep 17 00:00:00 2001 From: riperiperi Date: Sat, 12 Feb 2022 20:49:45 +0000 Subject: [PATCH] Cleanup --- Ryujinx.Graphics.Gpu/Engine/Twod/TwodClass.cs | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Ryujinx.Graphics.Gpu/Engine/Twod/TwodClass.cs b/Ryujinx.Graphics.Gpu/Engine/Twod/TwodClass.cs index 60e448071..9a2fd77e0 100644 --- a/Ryujinx.Graphics.Gpu/Engine/Twod/TwodClass.cs +++ b/Ryujinx.Graphics.Gpu/Engine/Twod/TwodClass.cs @@ -81,12 +81,12 @@ namespace Ryujinx.Graphics.Gpu.Engine.Twod /// /// Determine if the given region covers the full texture, also considering width alignment. /// - /// + /// The texture to check /// - /// - /// - /// - /// + /// Region start x + /// Region start y + /// Region end x + /// Region end y /// True if the region covers the full texture, false otherwise private bool IsCopyRegionComplete(TwodTexture texture, FormatInfo formatInfo, int x1, int y1, int x2, int y2) { @@ -154,6 +154,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Twod // If the copy is not equal to the width and height of the texture, we will need to copy partially. // It's worth noting that it has already been established that the src and dst are the same size. + if (w == width && h == height) { memoryManager.Write(dstGpuVa, srcSpan); @@ -201,16 +202,18 @@ namespace Ryujinx.Graphics.Gpu.Engine.Twod { int x = 0; + srcCalculator.SetY(y); + for (; x < strideTrunc; x += 16) { - int offset = srcCalculator.GetOffset(x, y) >> 4; + int offset = srcCalculator.GetOffset(x) >> 4; dstVec[offset] = srcVec[offset]; } for (; x < stride; x++) { - int offset = srcCalculator.GetOffset(x, y); + int offset = srcCalculator.GetOffset(x); dstSpan[offset] = srcSpan[offset]; } @@ -297,7 +300,6 @@ namespace Ryujinx.Graphics.Gpu.Engine.Twod IsCopyRegionComplete(srcCopyTexture, srcCopyTextureFormat, srcX1, srcY1, srcX2, srcY2) && IsCopyRegionComplete(dstCopyTexture, dstCopyTextureFormat, dstX1, dstY1, dstX2, dstY2); - var srcTexture = memoryManager.Physical.TextureCache.FindOrCreateTexture( memoryManager, srcCopyTexture, @@ -312,14 +314,12 @@ namespace Ryujinx.Graphics.Gpu.Engine.Twod if (canDirectCopy) { // Directly copy the data on CPU. - //Common.Logging.Logger.Warning?.Print(Common.Logging.LogClass.Gpu, $"Fast Copy {srcX2} {srcY2} {srcCopyTexture.Format}"); UnscaledFullCopy(srcCopyTexture, dstCopyTexture, srcX2, srcY2, srcCopyTextureFormat.BytesPerPixel); } return; } - //Common.Logging.Logger.Error?.Print(Common.Logging.LogClass.Gpu, $"Slow Copy {srcX2} {srcY2} {srcCopyTexture.Format}"); memoryManager.Physical.TextureCache.Lift(srcTexture); // When the source texture that was found has a depth format,