Not having seen the preceding moments, I can only speculate. I might well have had to shoot one or both, but it would have to have been before climbing to safety, as I must operate under the same "imminent threat" standard for discharging a firearm, whether the opponent is human, canine, or other creature. (I work in a mega-city, where there is no "safe" backstop, except the body of an opponent.) I would not swat at them with a baton, if they are truly climbing onto the vehicle, as that would be a credible, imminent threat.
Being perched on the hood of a patrol car is certainly an unenviable position. I would really try to avoid it!
Informally, if there is time, my colleagues sometimes try to get someone to respond to a dangerous-dog scene with a shotgun, as pellets are seen as less dangerous to the down-range public than handgun and rifle bullets. This is not written into policy. I carry a shotgun at work, and prefer it because it does more than just make holes at close range.
Collectively, we shoot quite a few dogs, mostly ones with the appearance of what would be more-or-less defined as "pit bull."
I have generally found that dogs understand my body language and verbal commands well enough to cease and desist. The closest I came to shooting a dog, was a loose Rottweiler, trying to claim about half a city block as its territory, with my AR15, when I feared I could not get oblivious pedestrians and cyclists to keep their distance. I was able to get the attention of someone inside the house, with my PA system, before anything became imminent.