mesa: Validate target before resolving tex obj in glTex(ture)SubImageXD
authorEduardo Lima Mitev <elima@igalia.com>
Wed, 29 Jul 2015 14:01:26 +0000 (16:01 +0200)
committerEduardo Lima Mitev <elima@igalia.com>
Wed, 5 Aug 2015 06:20:16 +0000 (08:20 +0200)
commit5d64cae8427b090c42d6d38da7fb474b3ddd4eb0
treef08febbe7cde3bffafb47406559c16c4ff081b05
parentb38a50f1e3edae6079c91f73a8d9c63a2dbf512a
mesa: Validate target before resolving tex obj in glTex(ture)SubImageXD

Currently, glTexSubImageXD attempt to resolve the texture object
(by calling _mesa_get_current_tex_object()) before validating the given
target. However, that method explicitly states that target must have been
validated before calling it, so it never returns a user error.

The target validation occurs later when texsubimage_error_check() is called.

This patch reorganizes target validation, taking it out from the error check
function and into a point before the texture object is resolved.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: 10.6 <mesa-stable@lists.freedesktop.org>
src/mesa/main/teximage.c