OSDN Git Service

mesa: Fix order of format+type and internal format checks for glTexImageXD ops
authorEduardo Lima Mitev <elima@igalia.com>
Thu, 24 Sep 2015 08:57:41 +0000 (10:57 +0200)
committerEmil Velikov <emil.l.velikov@gmail.com>
Mon, 28 Sep 2015 19:29:41 +0000 (20:29 +0100)
commit25e2a4136bc9b2cd503022eb39fc4ae9e219d1d4
tree1360992a82b880fe71674c3b16530bbaab9adb31
parentead4ce53f77f75936cd9044d6dc467d533e19bf0
mesa: Fix order of format+type and internal format checks for glTexImageXD ops

The more specific GLES constrains should be checked after the general
validation performed by _mesa_error_check_format_and_type(). This is also
for consistency with the error checks order of glTexSubImage ops.

v3: The change of order uncovered a bug that regresses a couple of piglit
tests written against OpenGL-ES 1.1 spec, which expects an INVALID_VALUE
instead of the INVALID_ENUM returned by _mesa_error_check_format_and_type()
when an invalid format is passed to glTexImage2D. This version of the patch
accounts for those cases.

Fixes 1 dEQP test:
* dEQP-GLES3.functional.negative_api.texture.teximage2d

Cc: "11.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Tested-by: Mark Janes <mark.a.janes@intel.com>
(cherry picked from commit 15ab968f62dd322ecda6d70b1069f52616fe39bb)
src/mesa/main/teximage.c