Skip to content

vulkan,spirv: Updates for the final ray-tracing extensions

This MR contains header updates for Vulkan and SPIR-V as well as updates to the SPIR-V parser to support the final version of the ray-tracing spec.

There are three primary changes to the SPIR-V spec from the provisional implemented here:

  1. OpTraceRay and OpExecuteCallable take a pointer to the ray payload or callable data instead of an integer specifying a location. This makes parsing way more robust.
  2. There is now an OpConvertUToAccelerationStructure opcode for passing 64-bit GPU addresses to acceleration structures into the shader instead of using normal bindings. This is useful in its own right but was specifically designed for D3D12 DXR emulation on top of Vulkan.
  3. OpTerminateRayKHR and OpIgnoreIntersectionKHR are now block-terminator instructions similar to OpKill and OpTerminate.

Unfortunately, in NIR, the third one is a bit dicy in the same way that OpKill is currently a bit dicy. Once !5071 (merged) lands, we can do this more properly by emitting a nir_jump_halt after the terminate/igore intrinsic.

Merge request reports