New tests show each optional node is connected after the nodes on either side are connected. This is an issue in the game Psycho Sleuth (at least in the demo) because it uses a transform which must have its input types enumerated before it will work correctly. This occurs when a decoder is inserted before the transform, but an optional node lies immediately upstream of the transform, and if optional nodes are not handled correctly, the decoder is initially connected to the optional instead of being inserted later. A couple of other issues revealed while making new tests are fixed here too. -- v3: mf/topology_loader: Try to insert optional nodes after resolving the surrounding branch. mf/topology_loader: Resolve topologies by walking down from each source node. mf/topology_loader: Introduce a helper to get the connection semantic flags. mf/tests: Test optional topology nodes. mf/tests: Fix comments for two topology loader tests. https://gitlab.winehq.org/wine/wine/-/merge_requests/10645