Avoid creating a pass for main_transparent_pass_2d when unecessary (#24850)