glthread: use 32-bit align instead of 64-bit ALIGN
authorMarek Olšák <marek.olsak@amd.com>
Fri, 27 Mar 2020 09:57:56 +0000 (05:57 -0400)
committerMarge Bot <eric+marge@anholt.net>
Mon, 27 Apr 2020 11:56:06 +0000 (11:56 +0000)
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4758>

src/mesa/main/glthread_marshal.h

index 8fc65d298625e6af714e78e49af6b4f65a22cca6..f464f2bd56577c587ed96033da9cce540aefd382 100644 (file)
@@ -59,13 +59,13 @@ _mesa_glthread_allocate_command(struct gl_context *ctx,
    struct glthread_state *glthread = &ctx->GLThread;
    struct glthread_batch *next = &glthread->batches[glthread->next];
    struct marshal_cmd_base *cmd_base;
-   const int aligned_size = ALIGN(size, 8);
 
    if (unlikely(next->used + size > MARSHAL_MAX_CMD_SIZE)) {
       _mesa_glthread_flush_batch(ctx);
       next = &glthread->batches[glthread->next];
    }
 
+   const int aligned_size = align(size, 8);
    cmd_base = (struct marshal_cmd_base *)&next->buffer[next->used];
    next->used += aligned_size;
    cmd_base->cmd_id = cmd_id;