Vulkan Samples and hardware capability viewer updated to final ray tracing extensions

Vulkan ray tracing extensions final specifications have been released

The finalized specifications for the cross-vendor hardware accelerated ray tracing extensions have finally been released, after being available as a provisional extension for some time now. So Vulkan now has official cross-vendor, cross-os support for accessing hardware accelerated ray tracing features. A great overview can be found on the Khronos blog, along with a great article on how ray tracing works.

The provisional extension has been split into multiple extensions:

  • VK_KHR_acceleration_structure
  • VK_KHR_ray_tracing_pipeline
  • VK_KHR_ray_query
  • VK_KHR_pipeline_library
  • VK_KHR_deferred_host_operations

Separating acceleration structures, ray queries (aka “inline ray tracing” in non ray tracing shader stages) and dedicated ray tracing pipelines broadens the target audience. With this setup, an IHV an e.g. only implement acceleration structures and ray queries.

For those that already used the provisional extensions: Aside from the separation into multiple extensions, there have been several important changes in how ray tracing works, esp. in regards to the setup. Getting sizes for the acceleration structure builds differ, the new functions consistently use buffer device addresses and the shader binding table setup also looks slightly different. All in all the new interface looks more consistent.

The provisional extension is now deprecated, so if you update your drivers, you won’t be able to use it anymore. So make sure to update your code to the new finalized extensions.

It’s expected that this will also enable mobile GPU vendors to add ray tracing to some degree. NVIDIA and AMD already offer drivers that support the new extensions, and it’s expected that Intel will soon join them with their new dedicated GPUs.

Other components like glslang are already up-to-date, which is required for generating proper SPIR-V 1.4 from glslang shaders. Other components like LunarG’s Vulkan SDK and the validation layers will also be updated soon.

Updated Vulkan samples

I have updated all my C++ Vulkan Samples to use the new extensions to help you get started or update your own code from the provisional extensions. In addition to this, I also added two new samples:

Ray queries

Ray queries can be used to do ray intersections in any shader stage (not only ray tracing shader stages). This example makes uses ray queries to add ray casted shadows to a rasterizer in the fragment shader.

Source

Callable shaders

Callable shaders can be dynamically called from other ray tracing shaders to execute different shaders based on conditions. The example ray traces multiple geometries, with each calling a different callable shader from the closest hit shader.

Source

An update for my ray tracing sample in the official Khronos sample repository is also in preparation, for those of you that prefer a more official source for sample code.

Updated Vulkan Hardware Capability Viewer

I have also released an updated Version (2.23) of the Vulkan Hardware Capability Viewer with support for these new ray tracing related extensions, so you can already check support for different devices in the database.