mesa: call FLUSH_VERTICES before updating CoordReplace
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>
diff --git a/src/mesa/main/texenv.c b/src/mesa/main/texenv.c
index c9fcce2..5d0dc6c 100644
--- a/src/mesa/main/texenv.c
+++ b/src/mesa/main/texenv.c
@@ -491,16 +491,17 @@
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 );