From ed37c4d350a8f4fc21b3ed2873dd99df1fed6b74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Wed, 3 Feb 2021 13:13:51 -0500 Subject: [PATCH] mesa: don't update the fixed-func frag prog on irrelevant _NEW_COLOR changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Zoltán Böszörményi Acked-by: Pierre-Eric Pelloux-Prayer Part-of: --- src/mesa/main/enable.c | 3 ++- src/mesa/main/state.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index 730718d6228..1f835fddd78 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -417,7 +417,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) if (ctx->Color.AlphaEnabled == state) return; /* AlphaEnabled is used by the fixed-func fragment program */ - FLUSH_VERTICES(ctx, _NEW_COLOR, GL_COLOR_BUFFER_BIT | GL_ENABLE_BIT); + FLUSH_VERTICES(ctx, _NEW_COLOR | _NEW_FF_FRAG_PROGRAM, + GL_COLOR_BUFFER_BIT | GL_ENABLE_BIT); ctx->NewDriverState |= ctx->DriverFlags.NewAlphaTest; ctx->Color.AlphaEnabled = state; break; diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index 389db5f0f71..9a77ef358b1 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -487,7 +487,7 @@ _mesa_update_state_locked( struct gl_context *ctx ) GLbitfield prog_flags = _NEW_PROGRAM; if (ctx->FragmentProgram._UsesTexEnvProgram) { - prog_flags |= _NEW_BUFFERS | _NEW_TEXTURE_OBJECT | _NEW_COLOR | + prog_flags |= _NEW_BUFFERS | _NEW_TEXTURE_OBJECT | _NEW_FF_FRAG_PROGRAM | _NEW_TEXTURE_STATE; }