diff --git a/src/gallium/auxiliary/util/u_threaded_context.c b/src/gallium/auxiliary/util/u_threaded_context.c index 48efc0e0482..dc2b9f47a7b 100644 --- a/src/gallium/auxiliary/util/u_threaded_context.c +++ b/src/gallium/auxiliary/util/u_threaded_context.c @@ -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 } /******************************************************************** diff --git a/src/gallium/auxiliary/util/u_threaded_context.h b/src/gallium/auxiliary/util/u_threaded_context.h index d8ae0c810d3..9b329ba3f33 100644 --- a/src/gallium/auxiliary/util/u_threaded_context.h +++ b/src/gallium/auxiliary/util/u_threaded_context.h @@ -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 {