diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index 92dc1d3d1ac..bd8a44b5788 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -248,7 +248,6 @@ _mesa_PushAttrib(GLbitfield mask) struct gl_texture_object *dst = &head->Texture.SavedObj[u][tex]; struct gl_texture_object *src = ctx->Texture.Unit[u].CurrentTex[tex]; - dst->Target = src->Target; dst->Name = src->Name; memcpy(&dst->Sampler.Attrib, &src->Sampler.Attrib, sizeof(src->Sampler.Attrib)); memcpy(&dst->Attrib, &src->Attrib, sizeof(src->Attrib)); @@ -597,7 +596,7 @@ pop_texture_group(struct gl_context *ctx, struct gl_texture_attrib_node *texstat /* We don't need to check whether the texture target is supported, * because we wouldn't get in this conditional block if it wasn't. */ - _mesa_BindTexture_no_error(savedObj->Target, savedObj->Name); + _mesa_BindTexture_no_error(texObj->Target, savedObj->Name); texObj = _mesa_get_tex_unit(ctx, u)->CurrentTex[tgt]; } diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 530f89d1e53..d3e3ff73501 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -5053,7 +5053,9 @@ struct gl_texture_attrib_node struct gl_fixedfunc_texture_unit FixedFuncUnit[MAX_TEXTURE_COORD_UNITS]; GLfloat LodBias[MAX_TEXTURE_UNITS]; - /** to save per texture object state (wrap modes, filters, etc): */ + /* For saving per texture object state (wrap modes, filters, etc), + * SavedObj[][].Target is unused, so the value is invalid. + */ struct gl_texture_object SavedObj[MAX_TEXTURE_UNITS][NUM_TEXTURE_TARGETS]; /* We need to keep a reference to the shared state. That's where the