mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-03 06:30:24 +01:00
glthread: reduce pointer dereferences in glthread_unmarshal_batch
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3948>
This commit is contained in:
parent
19151e2605
commit
313e98fb81
1 changed files with 6 additions and 4 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue