From: Samuel Pitoiset Date: Wed, 19 Jul 2017 07:39:42 +0000 (+0200) Subject: mesa: add primitive_restart_index() helper X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=de4e5b4dac51a1b667ce2fe8218d3969b88252bc;p=mesa.git mesa: add primitive_restart_index() helper Signed-off-by: Samuel Pitoiset Reviewed-by: Timothy Arceri --- diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c index db9261f1058..6aa4c72bdd1 100644 --- a/src/mesa/main/varray.c +++ b/src/mesa/main/varray.c @@ -1923,6 +1923,16 @@ _mesa_MultiModeDrawElementsIBM( const GLenum * mode, const GLsizei * count, } +static void +primitive_restart_index(struct gl_context *ctx, GLuint index) +{ + if (ctx->Array.RestartIndex != index) { + FLUSH_VERTICES(ctx, 0); + ctx->Array.RestartIndex = index; + } +} + + /** * GL_NV_primitive_restart and GL 3.1 */ @@ -1936,10 +1946,7 @@ _mesa_PrimitiveRestartIndex(GLuint index) return; } - if (ctx->Array.RestartIndex != index) { - FLUSH_VERTICES(ctx, 0); - ctx->Array.RestartIndex = index; - } + primitive_restart_index(ctx, index); }