From e269d1605d66d449c0dd710d43c5d18ecac4c1a9 Mon Sep 17 00:00:00 2001 From: Isaac Marovitz Date: Fri, 28 Jul 2023 15:09:40 -0400 Subject: [PATCH] Fix byte alignment --- src/Ryujinx.Graphics.Metal/Texture.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ryujinx.Graphics.Metal/Texture.cs b/src/Ryujinx.Graphics.Metal/Texture.cs index 23a2486222..7dd73ae5b7 100644 --- a/src/Ryujinx.Graphics.Metal/Texture.cs +++ b/src/Ryujinx.Graphics.Metal/Texture.cs @@ -116,7 +116,7 @@ namespace Ryujinx.Graphics.Metal public void SetData(SpanOrArray data, int layer, int level, Rectangle region) { - ulong bytesPerRow = (ulong)(Info.Width * Info.BytesPerPixel); + ulong bytesPerRow = (ulong)Info.GetMipStride(level); ulong bytesPerImage = 0; if (MTLTexture.TextureType == MTLTextureType.Type3D)