vc4: move the draw splitting routine to shared code