anv: Do not copy garbage to batch_bo

batch_size is the aligned value so it is >= than the actual number
of bytes in anv_batch.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18110>
This commit is contained in:
José Roberto de Souza 2022-08-10 12:02:31 -07:00 committed by Marge Bot
parent 631794b8a9
commit 87b19c68d8

View file

@ -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;