Doing it as a separate pass caused trouble when a variable was accessed
both with passthrough and explicitly. Two input variable declarations
were generated and only one of them was linked to the output variable of
the previous stage, leading to the output variable being removed.