If it would depend on the shape (without additional charges somewhere), you could find a volume without charges, but with nonzero total flux. You could then divide that volume into smaller parts, and you would always get at least one part with nonzero total flux, but without charges.
Maxwell's laws allow to derive ##div(E)=\rho## plus prefactors. In particular, for a very small volume, E is nearly constant. It is hard to imagine a very small volume with zero divergence inside, but nonzero total flux on its surface.
