mesa: Use shared code for converting shader targets to short strings.