From d5502b02b14c112b83f3f43f6d99796e2bc40007 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);