swapchain: add optional wait_for_frame param
Certain contexts (e.g. wayland) prefer to check callbacks and various things before drawing the next frame is actually started. Give them a generic mechanism in the swapchain for doing this.
I tested this with some local changes to mpv with the new gpu-next vo, and it worked as I expected.
Edited by Dudemanguy