diff --git a/src/intel/vulkan/anv_batch_chain.c b/src/intel/vulkan/anv_batch_chain.c index e81df2f2086..c65c0f33fa7 100644 --- a/src/intel/vulkan/anv_batch_chain.c +++ b/src/intel/vulkan/anv_batch_chain.c @@ -2425,10 +2425,11 @@ anv_queue_submit_simple_batch(struct anv_queue *queue, */ assert(vk_queue_is_empty(&queue->vk)); - uint32_t batch_size = align_u32(batch->next - batch->start, 8); + const uint32_t batch_size = batch->next - batch->start; + const uint32_t batch_bo_size = align_u32(batch_size, 8); struct anv_bo *batch_bo = NULL; - result = anv_bo_pool_alloc(&device->batch_bo_pool, batch_size, &batch_bo); + result = anv_bo_pool_alloc(&device->batch_bo_pool, batch_bo_size, &batch_bo); if (result != VK_SUCCESS) return result;