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> (cherry picked from commit 5d64cae8) [Emil Velikov: s/_mesa_enum_to_string/_mesa_lookup_enum_by_nr/] Signed-off-by:
Emil Velikov <emil.l.velikov@gmail.com> Conflicts: src/mesa/main/teximage.c