From fb0871dbc80454c7de102f4c39665f11d849959a Mon Sep 17 00:00:00 2001 From: Vladislav Mikhalin Date: Sun, 9 Feb 2025 16:11:24 +0300 Subject: [PATCH] ajm: mark empty batches as finished immediately (#2385) --- src/core/libraries/ajm/ajm_context.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/core/libraries/ajm/ajm_context.cpp b/src/core/libraries/ajm/ajm_context.cpp index 8992dd83b..0e2915f32 100644 --- a/src/core/libraries/ajm/ajm_context.cpp +++ b/src/core/libraries/ajm/ajm_context.cpp @@ -141,7 +141,12 @@ int AjmContext::BatchStartBuffer(u8* p_batch, u32 batch_size, const int priority *out_batch_id = batch_id.value(); batch_info->id = *out_batch_id; - batch_queue.EmplaceWait(batch_info); + if (!batch_info->jobs.empty()) { + batch_queue.EmplaceWait(batch_info); + } else { + // Empty batches are not submitted to the processor and are marked as finished + batch_info->finished.release(); + } return ORBIS_OK; }