draw: rework handling of non-existing outputs in emit code