From 61cfd8e72fe4a0de4e17668469aaf9128fd32c81 Mon Sep 17 00:00:00 2001 From: Isaac Marovitz Date: Fri, 6 Sep 2024 13:33:35 +0200 Subject: [PATCH] Fix cubemap array length Fixes crash in Sonic Frontiers --- src/Ryujinx.Graphics.Metal/Texture.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Ryujinx.Graphics.Metal/Texture.cs b/src/Ryujinx.Graphics.Metal/Texture.cs index 1e2d83680..551c98717 100644 --- a/src/Ryujinx.Graphics.Metal/Texture.cs +++ b/src/Ryujinx.Graphics.Metal/Texture.cs @@ -35,7 +35,14 @@ namespace Ryujinx.Graphics.Metal } else if (info.Target != Target.Cubemap) { - descriptor.ArrayLength = (ulong)Info.Depth; + if (info.Target == Target.CubemapArray) + { + descriptor.ArrayLength = (ulong)(Info.Depth / 6); + } + else + { + descriptor.ArrayLength = (ulong)Info.Depth; + } } MTLTextureSwizzleChannels swizzle = GetSwizzle(info, descriptor.PixelFormat);