anv: Better handle 32-byte alignment of descriptor set buffers
authorJason Ekstrand <jason@jlekstrand.net>
Fri, 26 Apr 2019 03:23:23 +0000 (22:23 -0500)
committerJason Ekstrand <jason@jlekstrand.net>
Fri, 26 Apr 2019 05:40:28 +0000 (05:40 +0000)
commitbaf4802e3e92b1512472d553dacbfbb2185c995b
treec4fcdeb6e8628724b63c156865810ad3a950c06c
parentd946cbe9f54a1b733e0bdec2423ae47d408114fb
anv: Better handle 32-byte alignment of descriptor set buffers

In c520f4dec9c, we chose to align the sizes of descriptor set buffers to
32 bytes.  We have to align the descriptor set buffer to 32B so that
it's valid for using with push constants.  We align the size as well so
we don't leave lots of holes with util_vma_heap_alloc.  Unfortunately,
we were only aligning it for alloc and not for free so we were still
creating piles of holes when we delete descriptor sets.  This causes
terrible perf for the allocator once we've deleted piles of descriptor
sets.

This commit reworks the code so that we align the descriptor set buffer
size to 32B for both alloc and free.  The result is that it takes the
new crucible vkResetDescriptorPool from 104.567719 to 2.898354 seconds.

Fixes: c520f4dec9c "anv: Add a concept of a descriptor buffer"
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110497
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
src/intel/vulkan/anv_descriptor_set.c