Sparse Bindless Buffers

Hello fellow Community,

I am having trouble trying to wrap my head around ARB_sparse_buffer and NV_shader_buffer_load / NV_vertex_buffer_unified_memory because none of the specs mentions interaction with each other.
Specifically everything worked fine until I started adding support for sparse buffers (unified vertex buffer memory was implemented successfully at that point already)
So because the code base is quite large I would like to ask questions about the general usage pattern instead of providing tons of code

  1. The correct order would be to first create a buffer (say glCreateBuffers), create virtual storage with glNamedBufferStorage including the sparse bit, get the GPU address with glGetNamedBufferParameterui64NV, make the buffer resident with glMakeNamedBufferResidentNV and then commit pages as needed with glNamedBufferPageCommitment taking into account the previously queried sparse buffer page size.
    Here I am wondering, the GPU address must be a virtual address obviously because no pysical memory has been allocated yet, meaning I can just use subregions of that buffer by adding the offset to the GPU address (same as when not using sparse, so the only difference is making sure pages are committed prior to glBufferSubData). So are the order as well as assumptions correct?
    I would love to hear technical details in case anyone feels like sharing them.

  2. When using glNamedBufferPageCommitment with false to free pages, the driver is still ultimately managing this and similar to glDeleteXX will first free the memory once all commands that have been queued prior to uncommitting the pages have been realized? Or do I need to place fences and check manually before uncommitting?
    Subquestion 2.1) What about calling glDeleteBuffers for that buffer without previously manually uncommiting the pages?
    Subquestion 2.2) What about uncommitting pages that are part of an address range currently set via glBufferAddressRangeNV?

By the way, I am on Java using LWJGL and since I started using sparse buffers I get an EXCEPTION_ACCESS_VIOLATION in org.lwjgl.glfw.GLFW.glfwDestroyWindow() which is why I am specifically interested in deleting those buffers, thinking this is actually related I am optimistic enough to believe I can figure that exception out on my own once my assumptions and questions are answered.

Thanks a lot in advance and many greetings from the shire,