mesa,meta: move gl_texture_object::TargetIndex initializations
authorBrian Paul <brianp@vmware.com>
Mon, 5 Oct 2015 14:14:56 +0000 (08:14 -0600)
committerBrian Paul <brianp@vmware.com>
Thu, 8 Oct 2015 19:53:33 +0000 (13:53 -0600)
commit7d7dd1871174905dfdd3ca874a09d9d7837ac743
treead0ddb10b205a163cbd567f18150c3290a23729b
parentd61f492aba354283933b5d84e3daacc45a836141
mesa,meta: move gl_texture_object::TargetIndex initializations

Before, we were unconditionally assigning the TargetIndex field in
_mesa_BindTexture(), even if it was already set properly.  Now we
initialize TargetIndex wherever we initialize the Target field, in
_mesa_initialize_texture_object(), finish_texture_init(), etc.

v2: also update the meta_copy_image code.  In make_view() the
view_tex_obj->Target field was set, but not the TargetIndex field.
Also, remove a second, redundant assignment to view_tex_obj->Target.
Add sanity check assertions too.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Tested-by: Mark Janes <mark.a.janes@intel.com>
src/mesa/drivers/common/meta_copy_image.c
src/mesa/main/shared.c
src/mesa/main/texobj.c
src/mesa/main/textureview.c