Moving from Godot 4.3 to 4.4, DirectionalLight3D nodes are not illuminating the scene and are not recognized in the sky shader

Godot Version

v4.4.stable.mono.official [4c311cbee]

Question

I have written (under Godot 4.3) a sky shader that uses two DirectionalLight3D nodes that populate shader builtin values in LIGHT0_xxx and LIGHT1_xxx. In Godot 4.4, my debugging shows that LIGHT0_ENABLED and LIGHT1_ENABLED are false in the shader. The lights are also not illuminating the terrain in the scene (a separate spot light in the scene does illuminate the terrain – only the DirectionalLight3D objects do not). So this is not strictly a shader issue.

What might have changed 4.3-4.4 that would stop the DirectionalLight3D from working?

Answering my own question!

In 4.3, the DirectionalLight3D VisualInstance3D Layers mask did not need to be set and light_cull_mask could be used to determine which layers were illuminated. In 4.4, it looks like Layers mask is required for the first time. This was some of the very first code I wrote in Godot, over a year ago, so I need to do a thorough review.

If someone can illuminate (!) my answer with more details or explanation, please do so.