mesa: call FLUSH_VERTICES before updating CoordReplace
authorMarek Olšák <marek.olsak@amd.com>
Thu, 20 Feb 2020 02:43:56 +0000 (21:43 -0500)
committerMarge Bot <eric+marge@anholt.net>
Wed, 26 Feb 2020 22:10:35 +0000 (22:10 +0000)
Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
Cc: 20.0 <mesa-stable@lists.freedesktop.org>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3947>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3947>

src/mesa/main/texenv.c

index c9fcce2faf3d47a06e972c24b79c47cd579d2f88..5d0dc6cc4e9690a579690c5fc23a417d5e72178d 100644 (file)
@@ -491,16 +491,17 @@ _mesa_texenvfv_indexed( struct gl_context* ctx, GLuint texunit, GLenum target,
          if (iparam0 == GL_TRUE) {
             if (ctx->Point.CoordReplace & (1u << texunit))
                return;
+            FLUSH_VERTICES(ctx, _NEW_POINT);
             ctx->Point.CoordReplace |= (1u << texunit);
          } else if (iparam0 == GL_FALSE) {
             if (~(ctx->Point.CoordReplace) & (1u << texunit))
                return;
+            FLUSH_VERTICES(ctx, _NEW_POINT);
             ctx->Point.CoordReplace &= ~(1u << texunit);
          } else {
             _mesa_error( ctx, GL_INVALID_VALUE, "glTexEnv(param=0x%x)", iparam0);
             return;
          }
-         FLUSH_VERTICES(ctx, _NEW_POINT);
       }
       else {
          _mesa_error( ctx, GL_INVALID_ENUM, "glTexEnv(pname=0x%x)", pname );