Mesa (17.3): Revert "mesa: do not trigger _NEW_TEXTURE_STATE in glActiveTexture()"

Juan Antonio Suárez Romero jasuarez at kemper.freedesktop.org
Mon Mar 19 11:25:43 UTC 2018


Module: Mesa
Branch: 17.3
Commit: 929a4473d47f2987534e7f3d446aab577725fe88
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=929a4473d47f2987534e7f3d446aab577725fe88

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Wed Mar 14 09:46:33 2018 +0100

Revert "mesa: do not trigger _NEW_TEXTURE_STATE in glActiveTexture()"

This reverts commit f314a532fdc7af8381586144d2631d9968331f05.

This appears to introduce some blinking textures in UT2004. Not
sure exactly what's the root cause because we don't have much
information about the issue.

Anyway, this was just a micro optimization that actually breaks,
at least, one app almost one year later.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105436
Cc: <mesa-stable at lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>
(cherry picked from commit f02f1ad13fa4123986d17a5d04b0e2831c3a7091)

---

 src/mesa/main/texstate.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c
index 2146723d08..fa876fa80b 100644
--- a/src/mesa/main/texstate.c
+++ b/src/mesa/main/texstate.c
@@ -307,6 +307,19 @@ active_texture(GLenum texture, bool no_error)
       }
    }
 
+
+   /* The below flush call seems useless because
+    * gl_context::Texture::CurrentUnit is not used by
+    * _mesa_update_texture_state() and friends.
+    *
+    * However removing the flush
+    * introduced some blinking textures in UT2004. More investigation is
+    * needed to find the root cause.
+    *
+    * https://bugs.freedesktop.org/show_bug.cgi?id=105436
+    */
+   FLUSH_VERTICES(ctx, _NEW_TEXTURE_STATE);
+
    ctx->Texture.CurrentUnit = texUnit;
    if (ctx->Transform.MatrixMode == GL_TEXTURE) {
       /* update current stack pointer */




More information about the mesa-commit mailing list