Skip to content

TLASes can track BLASes they reference after a build + Submission Callbacks & Custom Lifetime Tracking

Pre-release
Pre-release
Compare
Choose a tag to compare
@devshgraphicsprogramming devshgraphicsprogramming released this 01 Apr 10:25
· 641 commits to master since this release
4e43183

Lifetime Tracking for any IReferenceCounted via a Command Buffer

Absolutely awesome feature, warranting a patch version bump.

You can now call bool IGPUCommandBuffer::recordReferences(const std::span<const IReferenceCounted*> refs); which will make the Command Buffer hold onto all the refs until its reset.

This makes it easy to do things such as make the Command Buffer hold onto the IGPUBuffers whose Buffer Device Addresses you use in the shaders.

TLASes can track BLASes they use after a build

The builds are versioned as Queue's MultiTimelineEventHandler don't immediately know that a submission has completed, the TLAS holds only one set of tracked BLASes at a time, only highest can be set.

You don't suffer from ABA signalling problem because callbacks from Host and Device builds hold onto the BLAS ranges they're about to set until the tracking info update time.

Of-course in true Nabla-style everything is overridable and callable directly by you if so wished (e.g. middleware usage).

Submission Completion Callbacks

This was doable before with the TimelineEventHandler but you were in charge of making it and doing your own polling, now if you want to be extra lazy you can abuse the IQueues built-in MultiTimelineEventHandler which it uses for CommandBuffer (and whatever it references) lifetime tracking.

Think of it as a counterpart to CUDA's cudaStreamAddCallback or cudaLaunchHostFunc.

If you put IReferenceCounted in your std::function<void()>'s internal state, this allows you to also perform custom lifetime tracking but for only a single submit (as opposed to a commandbuffer which may be reused).