Skip to content

WIP: turnip: VK_KHR_ray_query

Connor Abbott requested to merge cwabbott0/mesa:review/tu-ray-query into main

This adds support for accelerated ray queries present on a740+. This uses a common framework introduced in !28446 for building the BVH, and an encoder pass modified from radv. The ray_intersection instruction only handles one node at a time and we have to walk the tree ourselves, just like on AMD, so the lower_ray_query pass also borrows heavily from radv.

For more information about the HW format this is targeting, see https://gitlab.freedesktop.org/freedreno/freedreno/-/wikis/a7xx-ray-tracing.

There are a few things that need to be finished:

  • There is a lot of missing capability spew because the build shaders use int8 and int64, and these aren't fully implemented although the build shaders only use the usable subset. !28254 and !27776 will turn on the caps, or alternatively !28407 will nuke caps checking, we just need one of them to land.
  • This probably needs some more real-world testing.

Nevertheless, it passes all the CTS tests I could find, with one small caveat (sometimes dEQP-VK.ray_query.stress.tess_control_shader.aabbs takes too long with the default hangcheck period and triggers a hangcheck). In terms of performance, it reuses and should benefit from all the hard work that went into radv, so it shouldn't be that bad, even though I haven't done any tuning. However, known missing performance features are support for BVH updates (like radv has), utilizing the compressed leaf nodes, and tunin the size of the stack and possibly using shared memory for the stack like radv does.

Merge request reports