pan/midgard: Convert fragment writeout to proper branches