tc: flag closed batches

When tc_add_call_end is called the batch should never receive
new commands until it's executed.
Add a new assert to validate this expectation to help detect
failures.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33552>
This commit is contained in:
Pierre-Eric Pelloux-Prayer
2025-02-14 10:35:17 +01:00
committed by Marge Bot
parent f062c83f3a
commit 5980d60cf1
2 changed files with 12 additions and 0 deletions
@@ -473,6 +473,9 @@ tc_add_call_end(struct tc_batch *next)
#if !defined(NDEBUG) && TC_DEBUG >= 1
call->sentinel = TC_SENTINEL;
#endif
#if !defined(NDEBUG)
next->closed = true;
#endif
}
static void
@@ -537,6 +540,9 @@ tc_add_sized_call(struct threaded_context *tc, enum tc_call_id id,
}
tc_assert(util_queue_fence_is_signalled(&next->fence));
#if !defined(NDEBUG)
assert(!next->closed);
#endif
struct tc_call_base *call = (struct tc_call_base*)&next->slots[next->num_total_slots];
next->num_total_slots += num_slots;
@@ -5145,6 +5151,9 @@ tc_batch_execute(void *job, UNUSED void *gdata, int thread_index)
batch->first_set_fb = false;
batch->max_renderpass_info_idx = 0;
batch->tc->last_completed = batch->batch_idx;
#if !defined(NDEBUG)
batch->closed = false;
#endif
}
/********************************************************************
@@ -521,6 +521,9 @@ struct tc_batch {
struct tc_unflushed_batch_token *token;
uint64_t slots[TC_SLOTS_PER_BATCH];
struct util_dynarray renderpass_infos;
#if !defined(NDEBUG)
bool closed;
#endif
};
struct tc_buffer_list {