1
0
Fork 0

Merge pull request #103185 from stuartcarnie/metal_lazy

Metal: Compile `MTLLibrary` on demand when pipeline is created
This commit is contained in:
Thaddeus Crews 2025-02-24 19:52:23 -06:00
commit 5cfa89ed0e
No known key found for this signature in database
GPG Key ID: 62181B86FE9E5D84
1 changed files with 5 additions and 0 deletions

View File

@ -4082,9 +4082,14 @@ RenderingDeviceDriverMetal::RenderingDeviceDriverMetal(RenderingContextDriverMet
context_driver(p_context_driver) {
DEV_ASSERT(p_context_driver != nullptr);
#if TARGET_OS_OSX
if (String res = OS::get_singleton()->get_environment("GODOT_MTL_SHADER_LOAD_STRATEGY"); res == U"lazy") {
_shader_load_strategy = ShaderLoadStrategy::LAZY;
}
#else
// Always use the lazy strategy on other OSs like iOS, tvOS, or visionOS.
_shader_load_strategy = ShaderLoadStrategy::LAZY;
#endif
}
RenderingDeviceDriverMetal::~RenderingDeviceDriverMetal() {