Fix cubemap array length

Fixes crash in Sonic Frontiers
This commit is contained in:
Isaac Marovitz 2024-09-06 13:33:35 +02:00
parent c14d8cf2ee
commit 94579f2042
No known key found for this signature in database
GPG Key ID: 97250B2B09A132E1
1 changed files with 8 additions and 1 deletions

View File

@ -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);