anv: Implement SSBOs bindings with GPU addresses in the descriptor BO

Graphics / Mesa 3D Graphics Library / Mesa - Jason Ekstrand [] - 19 April 2019 19:56 EDT

This commit adds a new way for ANV to do SSBO bindings by just passing a GPU address in through the descriptor buffer and using the A64 messages to access the GPU address directly. This means that our variable pointers are now "real" pointers instead of a vec2(BTI, offset) pair. This carries a few of advantages:

1. It lets us support a virtually unbounded number of SSBO bindings.

2. It lets us implement VK_KHR_shader_atomic_int64 which we couldn't implement before because those atomic messages are only available in the bindless A64 form.

3. It's way better than messing around with bindless handles for SSBOs which is the only other option for VK_EXT_descriptor_indexing.

4. It's more future looking, maybe? At the least, this is what NVIDIA does (they don't have binding based SSBOs at all). This doesn't a priori mean it's better, it just means it's probably not terrible.

The big disadvantage, of course, is that we have to start doing our own bounds checking for robustBufferAccess again have to push in dynamic offsets.

79fb0d27f3a anv: Implement SSBOs bindings with GPU addresses in the descriptor BO
src/intel/vulkan/anv_cmd_buffer.c | 37 +++-
src/intel/vulkan/anv_descriptor_set.c | 37 +++-
src/intel/vulkan/anv_device.c | 14 +-
src/intel/vulkan/anv_nir_apply_pipeline_layout.c | 242 +++++++++++++++++++++--
src/intel/vulkan/anv_pipeline.c | 32 ++-
src/intel/vulkan/anv_private.h | 20 ++
6 files changed, 347 insertions(+), 35 deletions(-)


  • Share