hk: Use aligned vector fill in hk_CmdFillBuffer if possible

30% faster with 16KB buffers, more than twice as fast with 8MB and
larger buffers.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39780>
This commit is contained in:
Janne Grunau 2026-01-16 11:52:50 +01:00 committed by Marge Bot
parent 5c2d62c030
commit 651a321ee2

View file

@ -1493,7 +1493,12 @@ hk_CmdFillBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer,
uint64_t addr =
vk_meta_buffer_address(&dev->vk, dstBuffer, dstOffset, dstRange);
libagx_fill(cmd, agx_1d(range / 4), AGX_BARRIER_ALL, addr, data);
if (util_is_aligned(addr, 16) && util_is_aligned(range, 16)) {
libagx_fill_uint4(cmd, agx_2d(range / 16, 1), AGX_BARRIER_ALL,
addr, 0, data, data, data, data);
} else {
libagx_fill(cmd, agx_1d(range / 4), AGX_BARRIER_ALL, addr, data);
}
}
VKAPI_ATTR void VKAPI_CALL