mesa: don't push/pop gl_texture_object::Target

This field is immutable because each texture unit is an array of texture
target slots and only matching targets can be bound into each slot.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8181>
This commit is contained in:
Marek Olšák 2020-12-19 19:33:40 -05:00
parent 6c0a8ddb6f
commit 230b46bcee
2 changed files with 4 additions and 3 deletions

View file

@ -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];
}

View file

@ -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