I think I’d want something along the lines of a 50 cal machine gun for a T-rex.
20mm? If it’s close, you need fast knock down power to stop a reptile: quad-40.