mesa: reset primitive restart state in glClientAttribDefaultEXT
authorMarek Olšák <marek.olsak@amd.com>
Sun, 22 Mar 2020 00:01:37 +0000 (20:01 -0400)
committerMarge Bot <eric+marge@anholt.net>
Mon, 27 Apr 2020 11:56:06 +0000 (11:56 +0000)
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4758>

src/mesa/main/attrib.c

index b7e06ca21daa8a10f0909518a80d9e8603bc1687..e3df99b039674a9ce67d2ebc387fb4e17bd97fce 100644 (file)
@@ -1926,6 +1926,15 @@ _mesa_ClientAttribDefaultEXT( GLbitfield mask )
       }
 
       _mesa_ClientActiveTexture(GL_TEXTURE0);
+
+      _mesa_PrimitiveRestartIndex_no_error(0);
+      if (ctx->Version >= 31)
+         _mesa_Disable(GL_PRIMITIVE_RESTART);
+      else if (_mesa_has_NV_primitive_restart(ctx))
+         _mesa_DisableClientState(GL_PRIMITIVE_RESTART_NV);
+
+      if (_mesa_has_ARB_ES3_compatibility(ctx))
+         _mesa_Disable(GL_PRIMITIVE_RESTART_FIXED_INDEX);
    }
 }