vbo: return a GL error earlier in vbo_save_playback_vertex_list_gallium

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13506>
This commit is contained in:
Marek Olšák 2021-10-23 00:54:09 -04:00 committed by Marge Bot
parent fa2c39df0f
commit 97caca6b47
1 changed files with 6 additions and 6 deletions

View File

@ -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.