glthread: add a missing end-of-batch marker

Unmarshal calls that "look ahead" in the batch use it. They expect
the next call ID to be equal to a specific GL call. NUM_DISPATCH_CMD
is not equal to any GL call (it's last_call_id + 1).

This was missed in the referenced commit, causing assertion failures.

Fixes: c3b95d1507 - glthread: add a marker at the end of batches indicating the end

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26786>
This commit is contained in:
Marek Olšák 2023-12-08 21:38:30 -05:00 committed by Marge Bot
parent 9643671dae
commit 5a4eddc298

View file

@ -390,6 +390,11 @@ _mesa_glthread_finish(struct gl_context *ctx)
}
if (glthread->used) {
/* Mark the end of the batch, but don't increment "used". */
struct marshal_cmd_base *last =
(struct marshal_cmd_base *)&next->buffer[glthread->used];
last->cmd_id = NUM_DISPATCH_CMD;
p_atomic_add(&glthread->stats.num_direct_items, glthread->used);
next->used = glthread->used;
glthread->used = 0;