In this article
An inline ray query runs in its calling shader stage; a barrier aimed only at a separate ray-tracing pipeline stage can miss the actual consumer.
Draw the resource dependency first
A renderer can build an acceleration structure and then read it from an inline query in a compute shader. The relevant relationship is a build write followed by a shader’s acceleration read. Identify those operations before copying a synchronization snippet from another rendering path. Recording commands in a convenient textual order does not by itself specify every required execution and memory dependency for the resource consumed by the shader.
Separate dependent builds explicitly
The acceleration-build reference states that individual builds in one multi-build call have no implied ordering or synchronization. A top-level build cannot depend on a lower-level structure being created in that same call. Schedule dependent builds with the required boundaries and preserve the lower-level resources referenced by the resulting scene. Batching several build descriptions is not equivalent to expressing a dependency graph among them.
Target the actual inline consumer
The ray-query extension allows queries inside compute and graphics shaders, not only a dedicated ray-tracing pipeline. For a query executed in compute, include the compute shader stage in the destination scope. A stage name mentioning ray tracing is not a universal substitute for wherever ray-query instructions happen to execute. Keep the dependency attached to the real consumer path when moving an effect between shader stages or pipeline designs.
Match access scope as well as execution scope
The memory-barrier reference separates stage masks from access masks. The access-flag reference defines acceleration-structure read and write access. Specify the intended build producer and query consumer rather than treating an execution boundary alone as sufficient memory visibility. Cross-queue work may additionally require semaphore dependencies and, where applicable, queue-family ownership handling. A same-queue example should not silently be reused as a complete cross-queue protocol.
Validate changing geometry under load
Change a diagnostic scene between frames and check that query results always match the intended completed build. Exercise the real number of in-flight jobs and enable appropriate validation for the deployment. The guides to copy and compute overlap and GPU BVH traversal provide adjacent context. A temporary full-device wait can help isolate a suspected dependency issue, but the final design should express the actual producer, reader and resource lifetime instead of relying on accidental serialization.
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.