mesa: Make TexSubImage check negative dimensions sooner.
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 14 Apr 2016 09:19:59 +0000 (02:19 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 13 Jun 2016 22:38:47 +0000 (15:38 -0700)
commit2df8f4a2534e1e2258a719e7c5cbf342621fdf1f
tree9cc3c9c5002c8ca28c97c52f33865019b49b6d4b
parentcf9bb9acac0fd3b5926da8102bda33171a906a6b
mesa: Make TexSubImage check negative dimensions sooner.

Two dEQP tests expect INVALID_VALUE errors for negative width/height
parameters, but get INVALID_OPERATION because they haven't actually
created a destination image.  This is arguably not a bug in Mesa, as
there's no specified ordering of error conditions.

However, it's also really easy to make the tests pass, and there's
no real harm in doing these checks earlier.

Fixes:
dEQP-GLES3.functional.negative_api.texture.texsubimage3d_neg_width_height
dEQP-GLES31.functional.debug.negative_coverage.get_error.texture.texsubimage3d_neg_width_height

v2: Drop redundant check (caught by Anuj Phogat).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
src/mesa/main/teximage.c