projects
/
mesa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
glthread: reduce pointer dereferences in glthread_unmarshal_batch
[mesa.git]
/
src
/
mesa
/
main
/
glthread.c
diff --git
a/src/mesa/main/glthread.c
b/src/mesa/main/glthread.c
index 3b6051834834128cb238b59878d0a1de78d3f03e..eae468e211cb039846427a22b5b280fb1851d800 100644
(file)
--- 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;
{
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);
_glapi_set_dispatch(ctx->CurrentServerDispatch);
- while (pos <
batch->
used) {
+ while (pos < used) {
const struct marshal_cmd_base *cmd =
const struct marshal_cmd_base *cmd =
- (const struct marshal_cmd_base *)&b
atch->b
uffer[pos];
+ (const struct marshal_cmd_base *)&buffer[pos];
_mesa_unmarshal_dispatch[cmd->cmd_id](ctx, cmd);
pos += cmd->cmd_size;
}
_mesa_unmarshal_dispatch[cmd->cmd_id](ctx, cmd);
pos += cmd->cmd_size;
}
- assert(pos ==
batch->
used);
+ assert(pos == used);
batch->used = 0;
}
batch->used = 0;
}