mesa: fix invalid target error handling for teximage
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Mon, 14 Oct 2019 09:32:40 +0000 (11:32 +0200)
committerPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Wed, 16 Oct 2019 08:41:31 +0000 (10:41 +0200)
commit16233797f49359aadf104b5fe6bfff5b66914974
tree615e17d178f70c41085d872c8caa51c7c9521d5f
parent268e0e01f372ccbb3501ce57084acbe18cb4a196
mesa: fix invalid target error handling for teximage

This commit moves the target check before using _mesa_get_current_tex_object
to fix a "Mesa implementation error: bad target in _mesa_get_current_tex_object()"
error.

Fixes: 9dd1f7cec01 ("mesa: pass gl_texture_object as arg to not depend on state")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/mesa/main/teximage.c