Skip to content

Commit 5cfa89e

Browse files
committed
Merge pull request #103185 from stuartcarnie/metal_lazy
Metal: Compile `MTLLibrary` on demand when pipeline is created
2 parents 92fc09c + 818afcb commit 5cfa89e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/metal/rendering_device_driver_metal.mm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4082,9 +4082,14 @@ bool isArrayTexture(MTLTextureType p_type) {
40824082
context_driver(p_context_driver) {
40834083
DEV_ASSERT(p_context_driver != nullptr);
40844084

4085+
#if TARGET_OS_OSX
40854086
if (String res = OS::get_singleton()->get_environment("GODOT_MTL_SHADER_LOAD_STRATEGY"); res == U"lazy") {
40864087
_shader_load_strategy = ShaderLoadStrategy::LAZY;
40874088
}
4089+
#else
4090+
// Always use the lazy strategy on other OSs like iOS, tvOS, or visionOS.
4091+
_shader_load_strategy = ShaderLoadStrategy::LAZY;
4092+
#endif
40884093
}
40894094

40904095
RenderingDeviceDriverMetal::~RenderingDeviceDriverMetal() {

0 commit comments

Comments
 (0)