alLayer will layer two surface shaders together, including correctly blending their AOVs using a Mix parameter. The connected surface shaders will only be evaluated if their contribution would be noticeable, so it is safe to chain as many of these together as you like (assuming you don't set the Mix parameter to a constant on all of them - then it'll still be slow).
- Layer 1
- The layer that will be visible when the Mix parameter is 0
- Layer 2
- The layer that will be visible when the Mix parameter is 1
- Used to blend from layer 1 to layer 2
- Use this to temporarily disable the layering and show the selected input. This can be useful for checking everything's working as you expect and that your Mix value is behaving as expected. At its default value of "off" this parameter has no effect