From: Marek Olšák Date: Thu, 20 Feb 2020 21:20:25 +0000 (-0500) Subject: glthread: reduce pointer dereferences in glthread_unmarshal_batch X-Git-Tag: upstream/20.1.8~2817 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=313e98fb8111c21fc89d2422d50dc12daec4efc6;p=platform%2Fupstream%2Fmesa.git glthread: reduce pointer dereferences in glthread_unmarshal_batch Reviewed-by: Timothy Arceri Part-of: --- diff --git a/src/mesa/main/glthread.c b/src/mesa/main/glthread.c index 3b60518..eae468e 100644 --- a/src/mesa/main/glthread.c +++ b/src/mesa/main/glthread.c @@ -44,19 +44,21 @@ glthread_unmarshal_batch(void *job, int thread_index) { struct glthread_batch *batch = (struct glthread_batch*)job; struct gl_context *ctx = batch->ctx; - size_t pos = 0; + int pos = 0; + int used = batch->used; + uint8_t *buffer = batch->buffer; _glapi_set_dispatch(ctx->CurrentServerDispatch); - while (pos < batch->used) { + while (pos < used) { const struct marshal_cmd_base *cmd = - (const struct marshal_cmd_base *)&batch->buffer[pos]; + (const struct marshal_cmd_base *)&buffer[pos]; _mesa_unmarshal_dispatch[cmd->cmd_id](ctx, cmd); pos += cmd->cmd_size; } - assert(pos == batch->used); + assert(pos == used); batch->used = 0; }