Mesa (master): tu: Switch to the bindless descriptor model

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 9 16:15:24 UTC 2020


Module: Mesa
Branch: master
Commit: d37843fee15f953e18fa9e87c3dc4761ef054998
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d37843fee15f953e18fa9e87c3dc4761ef054998

Author: Connor Abbott <cwabbott0 at gmail.com>
Date:   Mon Mar 16 11:49:19 2020 +0100

tu: Switch to the bindless descriptor model

Under the bindless model, there are 5 "base" registers programmed with a
64-bit address, and sam/ldib/ldc and so on each specify a base register
and an offset, in units of 16 dwords. The base registers correspond to
descriptor sets in Vulkan. We allocate a buffer at descriptor set
creation time, hopefully outside the main rendering loop, and then
switching descriptor sets is just a matter of programming the base
registers differently. Note, however, that some kinds of descriptors
need to be patched at command recording time, in particular dynamic
UBO's and SSBO's, which need to be patched at CmdBindDescriptorSets
time, and input attachments which need to be patched at draw time based
on the the pipeline that's bound. We reserve the fifth base register
(which seems to be unused by the blob driver) for these, creating a
descriptor set on-the-fly and combining all the dynamic descriptors from
all the different descriptor sets. This way, we never have to copy the
rest of the descriptor set at draw time like the blob seems to do. I
mostly chose to do this because the infrastructure was already there in
the form of dynamic_descriptors, and other drivers (at least radv) don't
cheat either when implementing this.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4358>

---

 src/freedreno/vulkan/tu_cmd_buffer.c     | 735 +++++++++++--------------------
 src/freedreno/vulkan/tu_descriptor_set.c | 254 ++++++-----
 src/freedreno/vulkan/tu_descriptor_set.h |  40 +-
 src/freedreno/vulkan/tu_device.c         |  31 +-
 src/freedreno/vulkan/tu_pipeline.c       |  92 ++--
 src/freedreno/vulkan/tu_private.h        |  44 +-
 src/freedreno/vulkan/tu_shader.c         | 345 +++++++--------
 7 files changed, 673 insertions(+), 868 deletions(-)

Diff:   http://cgit.freedesktop.org/mesa/mesa/diff/?id=d37843fee15f953e18fa9e87c3dc4761ef054998


More information about the mesa-commit mailing list