mesa: move more format helper functions to glformats.c