TECHNOLOGY

Vulkan ray queries versus ray-tracing pipelines: choose where traversal logic executes

In this article
THE QUICK TAKE

A ray query returns traversal information to its calling shader; it does not launch the hit and miss shaders of a ray-tracing pipeline.

Start from the effect being implemented

A renderer adding a visibility test to an existing compute or raster stage has different integration needs from a renderer built around ray-generation and hit programs. Define where the application wants to process an intersection and how it obtains material data. Both approaches can use acceleration structures, but that shared geometric machinery does not make their shader execution models interchangeable or establish which design is faster for a particular GPU workload.

Understand inline ray-query control

The ray-query extension makes traversal queries available from shader types including graphics and compute. It explicitly states that queries return results to the caller rather than launching additional shaders. The calling shader therefore owns the surrounding control flow and application interpretation. This is useful context for integrating a local shadow or visibility operation without assuming that an existing closest-hit shader will be invoked automatically during the query.

Compare the pipeline’s shader domains

The ray-tracing pipeline extension introduces dedicated shader domains and shader-group binding for ray-driven execution. Program selection and shader invocation belong to that pipeline model. Porting an effect between the designs may require reorganizing material access and hit handling, not merely replacing a function name. Preserve equivalent ray ranges, visibility rules and intended shading behavior when comparing outputs; otherwise an apparent performance difference may come from doing different work.

Query and enable the required capability

The ray-query feature reference distinguishes support discovery from enabling the feature at device creation. Check the full dependency and feature requirements of the chosen design on the actual worker. A Vulkan-capable GPU is not automatically configured for either path. Record device, driver and enabled capabilities with the renderer configuration so a missing feature is diagnosed before shader compilation or the first production scene.

Benchmark an equivalent operation

Build a small representative effect and compare image or visibility results before timing it. Measure relevant shader cost, setup and resource use under realistic scene complexity. The guides to GPU ray coherence and renderer compatibility provide related context. Choose the execution model that fits the application’s control flow and supported deployment, then use measurements to assess performance; inline syntax alone does not guarantee less work or better scheduling than a dedicated ray-tracing pipeline.

Earn rental income from GPUs

Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.

Explore GPU hosting
← All articles