mesa: don't restore texture state into unbound textures in glPopAttrib
authorMarek Olšák <marek.olsak@amd.com>
Sat, 12 Dec 2020 04:46:42 +0000 (23:46 -0500)
committerMarge Bot <eric+marge@anholt.net>
Fri, 18 Dec 2020 04:53:44 +0000 (04:53 +0000)
It was a typo, or thinko, sort of.

Fixes: d0e18550e26 - mesa: optimize saving/restoring bound textures for glPush/PopAttrib

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8046>

src/mesa/main/attrib.c

index 51c3bc3..07285c5 100644 (file)
@@ -598,6 +598,7 @@ pop_texture_group(struct gl_context *ctx, struct gl_texture_attrib_node *texstat
              * because we wouldn't get in this conditional block if it wasn't.
              */
             _mesa_BindTexture_no_error(savedObj->Target, savedObj->Name);
+            texObj = _mesa_get_tex_unit(ctx, u)->CurrentTex[tgt];
          }
 
          memcpy(&texObj->Sampler.Attrib, &savedObj->Sampler.Attrib,