const uint32_t batch_padding = GFX8_MI_BATCH_BUFFER_START_length * 4;
/* Cap reallocation to chunk. */
uint32_t alloc_size = MIN2(
- MAX2(cmd_buffer->total_batch_size, size + batch_padding),
+ MAX2(batch->total_batch_size, size + batch_padding),
ANV_MAX_CMD_BUFFER_BATCH_SIZE);
VkResult result = anv_batch_bo_create(cmd_buffer, alloc_size, &new_bbo);
if (result != VK_SUCCESS)
return result;
- cmd_buffer->total_batch_size += alloc_size;
+ batch->total_batch_size += alloc_size;
struct anv_batch_bo **seen_bbo = u_vector_add(&cmd_buffer->seen_bbos);
if (seen_bbo == NULL) {
list_inithead(&cmd_buffer->batch_bos);
- cmd_buffer->total_batch_size = ANV_MIN_CMD_BUFFER_BATCH_SIZE;
-
result = anv_batch_bo_create(cmd_buffer,
- cmd_buffer->total_batch_size,
+ ANV_MIN_CMD_BUFFER_BATCH_SIZE,
&batch_bo);
if (result != VK_SUCCESS)
return result;
cmd_buffer->batch.alloc = &cmd_buffer->vk.pool->alloc;
cmd_buffer->batch.user_data = cmd_buffer;
+ cmd_buffer->batch.total_batch_size = ANV_MIN_CMD_BUFFER_BATCH_SIZE;
cmd_buffer->batch.extend_cb = anv_cmd_buffer_chain_batch;
assert(first_bbo->bo->size == ANV_MIN_CMD_BUFFER_BATCH_SIZE);
- cmd_buffer->total_batch_size = first_bbo->bo->size;
+ cmd_buffer->batch.total_batch_size = first_bbo->bo->size;
}
void
struct anv_batch {
const VkAllocationCallbacks * alloc;
+ /**
+ * Sum of all the anv_batch_bo sizes allocated for this command buffer.
+ * Used to increase allocation size for long command buffers.
+ */
+ size_t total_batch_size;
+
struct anv_address start_addr;
void * start;