From a04939662d55d5665e04f1cc87af09ef32cf6465 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sat, 19 Dec 2020 03:04:45 -0500 Subject: [PATCH] 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 Part-of: --- src/mesa/main/attrib.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index 0002be808f6..7229b3f1a18 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -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. */