radeonsi: add a slab allocator for bindless descriptors

Graphics / Mesa 3D Graphics Library / Mesa - Samuel Pitoiset [gmail.com] - 14 June 2017 04:04 EDT

For each texture/image handles, we need to allocate a new buffer for the bindless descriptor. But when the number of buffers added to the current CS becomes high, the overhead in the winsys (and in the kernel) is important.

To reduce this bottleneck, the idea is to suballocate the bindless descriptors using a slab similar to the one used in the winsys.

Currently, a buffer can hold 1024 bindless descriptors but this limit is arbitrary and could be changed in the future for some reasons. Once a slab is allocated the "base" buffer is added to a per-context list.

77bbdcd radeonsi: add a slab allocator for bindless descriptors
src/gallium/drivers/radeonsi/si_descriptors.c | 84 +++++++++++++++++++++++++++
src/gallium/drivers/radeonsi/si_pipe.c | 12 ++++
src/gallium/drivers/radeonsi/si_pipe.h | 15 +++++
src/gallium/drivers/radeonsi/si_state.h | 8 +++
4 files changed, 119 insertions(+)

Upstream: cgit.freedesktop.org


  • Share