mirror of
https://github.com/godotengine/godot.git
synced 2025-03-26 00:16:37 +08:00
This changes the default shader loading strategy, implemented in the Metal driver, to compile the `MTLLibrary` on demand when the pipeline is created, which reduces cold startup time on IPHONE target OSs. Normally, the `MTLLibrary` is compiled from Metal source asynchronously when Godot calls `RenderingDeviceDriverMetal::shader_create_from_bytecode`; however, this changes this behaviour on mobile platforms to do it on demand when the pipeline is created, as noted in #96052, Godot will ask to create many more shaders from bytecode than are initially required. Mobile OSs like iOS are limited to compiling to shader libraries concurrently, which results in a significant bottleneck. This is not the default for macOS, as it can concurrently compile many shaders at once, resulting in faster startup times for the Godot editor.