mesa: recover target_check before get_current_tex_objects
authorJose Maria Casanova Crespo <jmcasanova@igalia.com>
Wed, 21 Aug 2019 12:16:16 +0000 (13:16 +0100)
committerJose Maria Casanova Crespo <jmcasanova@igalia.com>
Wed, 21 Aug 2019 20:26:48 +0000 (21:26 +0100)
commit74a7e3ed3b297f441b406ff62ef9ba504ba3b06c
tree2bf95d6dd5e25052a2a04da28f89934e45bdadea
parent5baff5dd3c30baae75e5b121d3091a3b80435d1b
mesa: recover target_check before get_current_tex_objects

At compressed_tex_sub_image we only can obtain the tex_object after
compressed_subtexture_target_check is validated for TEX_MODE_CURRENT.
So if the target is wrong the error is raised to the user.

This completes the fix for the regression introduced on "mesa: refactor
compressed_tex_sub_image function" of the pending failing tests:

dEQP-GLES3.functional.negative_api.texture.compressedtexsubimage3d
dEQP-GLES31.functional.debug.negative_coverage.get_error.texture.compressedtexsubimage3d

v2: Fix warning that texObj might be used uninitialized (Gert Wollny)

Fixes: 7df233d68dc ("mesa: refactor compressed_tex_sub_image function")
Reviewed-By: Gert Wollny <gert.wollny@collabora.com>
src/mesa/main/teximage.c