mesa: Add explicit target checking to Get[Compressed]TexImage().
Previously, they relied on _mesa_max_texture_levels() for texture target
error checking. This was somewhat dodgy, as _mesa_max_texture_levels()
is called in seven diferent places, not all of which necessarily accept
the same list of targets.
I copied the list of legal targets from _mesa_max_texture_levels() but
removed the proxy targets, as both functions explicitly rejected those
targets. This changes the order in which we check errors, which could
change whether we return INVALID_VALUE or INVALID_ENUM. However, it
shouldn't change the list of accepted targets.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>