diff options
Diffstat (limited to 'src/mesa/main/glthread_marshal.h')
-rw-r--r-- | src/mesa/main/glthread_marshal.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mesa/main/glthread_marshal.h b/src/mesa/main/glthread_marshal.h index 67fa1e0e097..aac940dc08c 100644 --- a/src/mesa/main/glthread_marshal.h +++ b/src/mesa/main/glthread_marshal.h @@ -59,6 +59,8 @@ _mesa_glthread_allocate_command(struct gl_context *ctx, struct glthread_state *glthread = &ctx->GLThread; const unsigned num_elements = align(size, 8) / 8; + assert (num_elements <= MARSHAL_MAX_CMD_SIZE / 8); + if (unlikely(glthread->used + num_elements > MARSHAL_MAX_CMD_SIZE / 8)) _mesa_glthread_flush_batch(ctx); |