Hi,
This is indeed a non-trivial problem. Assuming a simple case where you are recording commands and submitting to a single queue, there are two things to be balanced really:
* The number of submissions: vkQueueSubmit is not free. Too many submissions has a significant overhead
* Keeping the GPU fed: On the other hand, too few submissions has the downside that the GPU may be left idle while the CPU is accumulating lots of commands
While the situation is particularly complicated for ANGLE (as an OpenGL layer with no knowledge of the future commands during recording), for normal Vulkan applications it's actually not that bad. Most games for example should work perfectly fine with a single submission, where the GPU is executing commands for one frame while the CPU is recording commands for the next. As a rule of thumb, you wouldn't want to be make more than 2 or 3 submissions, but really one should typically be enough.
One important thing to bear in mind is that splitting render passes is extremely expensive, especially on mobile devices (TBR architectures in particular), so your example of splitting the 5 draw calls in 5 submissions is doubly bad because it'll also use 5 render passes instead of 1.
In terms of code pointers, the logic is spread around ContextVk.cpp in various places, like
here (submit if app switches to another FBO),
here (submit because of a sync object),
here (submit because of a query), and more. If you're thinking of getting inspired for your Vulkan app, I would again warn that the situation for ANGLE is more complicated than for a typical Vulkan app, so I wouldn't try to mimic ANGLE.
Cheers