What is the order of operations for processing a material in Designer? Does the execution start at the output or the input?

For example, if I have a multi-switch node that inputs 10 variations and chooses a single image based on an index, does the processor need to generate all of the other 9 variations and throw them away?

If the processing works backwards, then only what is needed would likely be generated. But if it starts at the input node, I'm assuming every possible outcome is computed for every execution, even if only a fraction of it is used.

Thanks for any help!

For example, if I have a multi-switch node that inputs 10 variations and chooses a single image based on an index, does the processor need to generate all of the other 9 variations and throw them away?

If the processing works backwards, then only what is needed would likely be generated. But if it starts at the input node, I'm assuming every possible outcome is computed for every execution, even if only a fraction of it is used.

Thanks for any help!