Skip to content

anv: Implement acceleration structure basics

This MR brings in the basic support for acceleration structures in ANV. The only support for building acceleration structures that this MR provides is CPU-side building via Embree. The commit which adds this is marked WIP because the Embree solution isn't really ready for prime-time. There are three primary issues:

  1. Embree uses its own thread pool system so we can't easily tie it into deferred host operations. Embree does have some level of support for attaching client threads to the pool, at least if you build Embree with TBB. However, it only works at the whole-scene level and you can't attach threads for a BVH build.
  2. Embree uses its own thread-safe memory allocators and can't use the scratch memory pool provided by the client.
  3. Embree uses TBB which doesn't seem entirely safe for dynamic loading/unloading. I've had a bunch of issues with things crashing when the loader tries to dlclose() the driver thanks to TBB threads hanging around too long. This is arguably just a TBB bug but it's been problematic.

Note: This MR relies on a meson feature that only landed upstream last week.

Edited by Faith Ekstrand

Merge request reports