From 97caca6b477d7d1b9609ae94dcf6f832f285771c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sat, 23 Oct 2021 00:54:09 -0400 Subject: [PATCH] vbo: return a GL error earlier in vbo_save_playback_vertex_list_gallium Reviewed-by: Pierre-Eric Pelloux-Prayer Part-of: --- src/mesa/vbo/vbo_save_draw.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mesa/vbo/vbo_save_draw.c b/src/mesa/vbo/vbo_save_draw.c index 50d4896ef9b..6062969ccd7 100644 --- a/src/mesa/vbo/vbo_save_draw.c +++ b/src/mesa/vbo/vbo_save_draw.c @@ -208,6 +208,12 @@ vbo_save_playback_vertex_list_gallium(struct gl_context *ctx, if (ctx->NewState) _mesa_update_state(ctx); + /* Return precomputed GL errors such as invalid shaders. */ + if (!ctx->ValidPrimMask) { + _mesa_error(ctx, ctx->DrawGLError, "glCallList"); + return DONE; + } + /* Use the slow path when there are vertex inputs without vertex * elements. This happens with zero-stride attribs and non-fixed-func * shaders. @@ -225,12 +231,6 @@ vbo_save_playback_vertex_list_gallium(struct gl_context *ctx, struct pipe_vertex_state *state = node->merged.gallium.state[mode]; struct pipe_draw_vertex_state_info info = node->merged.gallium.info; - /* Return precomputed GL errors such as invalid shaders. */ - if (!ctx->ValidPrimMask) { - _mesa_error(ctx, ctx->DrawGLError, "glCallList"); - return DONE; - } - if (node->merged.gallium.ctx == ctx) { /* This mechanism allows passing references to the driver without * using atomics to increase the reference count.