Good day!
I have been tasked with investigating the possibility/feasibility of getting a UE-5.6.1 project running on iOS with Nanite enabled.
Our current project has utilized Nanite from the start and we’re quite close to shipping on other platforms. We don’t currently have capacity/resources to redo our assets with traditional LODs/fallbacks so our best bet would be to at least try and attempt to get Nanite working on iOS in some way, then we could evaluate the performance/stability and make a final call on whether it’s viable to ship with under the current constraints.
We understand that Nanite currently isn’t officially supported/available for iOS as it is not listed in the documentation under the Supported Platforms, but we’re wondering if there are any beta/experimental things we could try change in the engine on our side to get it working?
Is there a timeline for when nanite might be officially supported on iOS?
We’ve successfully managed to get the project running on MacOS with Nanite using the “Mac Metal Desktop Renderer Beta” with some great results on a Mac Studio M4. With that being the case, when selecting “Metal Desktop Renderer” in the iOS Platform settings, I take it that the “Metal Desktop Renderer” is a separate renderer implementation for iOS and is not using one of the RHI renderers listed in the Mac Platforms settings? My guess is that it won’t be as easy as just forcing it to use the Mac Beta renderer?
There is one more thing I would like to get some information/clarification on, regarding an issue that popped up when initially getting the project to run on iOS.
[UE] Assertion failed: Binding->index() < ML_MaxTextures [File:./Runtime/Apple/MetalRHI/Private/MetalPipeline.cpp] [Line: 507]
Metal texture index exceeded!
I’m using an iPhone 15 Pro to test on and found it a bit odd that this issue never presented itself on our Mac Studio M1. According to Apple’s documentation, if I read and understood it correctly, the Mac and iPhone’s texture bind limits are both 128 - https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf
I went looking in the engine code and saw that when compiling for iOS, the max textures value is hard coded and will always be 31 for any and all iOS devices.
#if PLATFORM_IOS
#define METAL_MAX_TEXTURES 31
I changed it to 128 as a test, gave it another go on the iPhone and it ran without any issues. Should this value rather not be set during engine startup/initialization, and query the GPU or check a device list/GPU family instead of it being hard coded?
Any thoughts, ideas, concerns or information would be greatly appreciated, and please feel free to ask if you need any other information or have questions!
Regards,
Piotr Dacewicz