mesa: Add explicit target checking to Get[Compressed]TexImage().
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 11 Jun 2012 02:06:23 +0000 (19:06 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Fri, 17 Aug 2012 16:14:36 +0000 (09:14 -0700)
commit63396ce4c0fe067f69d1b53d0408627a421c4678
tree027897088205a1ba8992408a31a9d5c0a57f14d9
parentf69273f9522a0c1486cf1870e35b3a16516f7233
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>
src/mesa/main/texgetimage.c