main: Fix target checking for CopyTexSubImage*D.
authorLaura Ekstrand <laura@jlekstrand.net>
Wed, 25 Feb 2015 23:45:47 +0000 (15:45 -0800)
committerLaura Ekstrand <laura@jlekstrand.net>
Thu, 26 Feb 2015 21:31:59 +0000 (13:31 -0800)
commitca65764d6042d2ea220a1e3952490f79c226f3e0
treebffac7e76fe3d4f34d040b389f08f86760d64351
parent688d7656c58ea4775dbd55fe56193a27f4799c00
main: Fix target checking for CopyTexSubImage*D.

This fixes a dEQP test failure.  In the test,
glCopyTexSubImage2D was called with target = 0 and failed to throw
INVALID ENUM. This failure was caused by _mesa_get_current_tex_object(ctx,
target) being called before the target checking.  To remedy this, target
checking was separated from the main error-checking function and
called prior to _mesa_get_current_tex_object.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89312

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
src/mesa/main/teximage.c