mesa: Add explicit target checking to Get[Compressed]TexImage().
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 <bd2562f754ec92342f93f61c25d731e290a2ffa8@whitecape.org>
Reviewed-by: Ian Romanick <2b237cafb16dc45038e85df6c85e74e6d899eba9@intel.com>

jbarczak/glsl-optimizer,mcanthony/glsl-optimizer,bkaradzic/glsl-optimizer,djreep81/glsl-optimizer,bkaradzic/glsl-optimizer,djreep81/glsl-optimizer,jbarczak/glsl-optimizer,metora/MesaGLSLCompiler,mapbox/glsl-optimizer,tokyovigilante/glsl-optimizer,mcanthony/glsl-optimizer,mcanthony/glsl-optimizer,benaadams/glsl-optimizer,dellis1972/glsl-optimizer,benaadams/glsl-optimizer,tokyovigilante/glsl-optimizer,djreep81/glsl-optimizer,zeux/glsl-optimizer,bkaradzic/glsl-optimizer,mapbox/glsl-optimizer,wolf96/glsl-optimizer,bkaradzic/glsl-optimizer,tokyovigilante/glsl-optimizer,mcanthony/glsl-optimizer,dellis1972/glsl-optimizer,mapbox/glsl-optimizer,zz85/glsl-optimizer,wolf96/glsl-optimizer,wolf96/glsl-optimizer,zz85/glsl-optimizer,djreep81/glsl-optimizer,wolf96/glsl-optimizer,tokyovigilante/glsl-optimizer,djreep81/glsl-optimizer,zz85/glsl-optimizer,zz85/glsl-optimizer,jbarczak/glsl-optimizer,zz85/glsl-optimizer,metora/MesaGLSLCompiler,zeux/glsl-optimizer,bkaradzic/glsl-optimizer,tokyovigilante/glsl-optimizer,metora/MesaGLSLCompiler,zeux/glsl-optimizer,dellis1972/glsl-optimizer,benaadams/glsl-optimizer,zeux/glsl-optimizer,mcanthony/glsl-optimizer,dellis1972/glsl-optimizer,benaadams/glsl-optimizer,jbarczak/glsl-optimizer,zz85/glsl-optimizer,benaadams/glsl-optimizer,zeux/glsl-optimizer,benaadams/glsl-optimizer,dellis1972/glsl-optimizer,jbarczak/glsl-optimizer,mapbox/glsl-optimizer,mapbox/glsl-optimizer,wolf96/glsl-optimizer