mesa: optimize most _mesa_ActiveTexture calls in glPopAttrib

_mesa_ActiveTexture changes CurrentUnit and the texture matrix stack
if the matrix mode is a texture matrix. In these cases, the texture matrix
stack is not touched.

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 03:04:45 -05:00
parent a4490541c6
commit a04939662d
1 changed files with 3 additions and 3 deletions

View File

@ -466,7 +466,7 @@ pop_enable_group(struct gl_context *ctx, const struct gl_enable_attrib_node *ena
if (old_enabled == enabled && old_gen_enabled == gen_enabled)
continue;
_mesa_ActiveTexture(GL_TEXTURE0 + i);
ctx->Texture.CurrentUnit = i;
if (old_enabled != enabled) {
TEST_AND_UPDATE_BIT(old_enabled, enabled, TEXTURE_1D_INDEX, GL_TEXTURE_1D);
@ -490,7 +490,7 @@ pop_enable_group(struct gl_context *ctx, const struct gl_enable_attrib_node *ena
}
}
_mesa_ActiveTexture(GL_TEXTURE0 + curTexUnitSave);
ctx->Texture.CurrentUnit = curTexUnitSave;
}
@ -511,7 +511,7 @@ pop_texture_group(struct gl_context *ctx, struct gl_texture_attrib_node *texstat
&ctx->Texture.FixedFuncUnit[u];
GLuint tgt;
_mesa_ActiveTexture(GL_TEXTURE0_ARB + u);
ctx->Texture.CurrentUnit = u;
if (ctx->Driver.TexEnv || ctx->Driver.TexGen) {
/* Slow path for legacy classic drivers. */