Skip to main content

Module rt

Module rt 

Source
Expand description

The ray tracing pipeline’s operations. WGSL has no ray tracing pipeline and naga’s has no ReportHit, IgnoreHit, CallShader or hit-group indices, so a ray tracing program (see crate::stage_functions) does what the pipeline does for it by calling functions of its own module that have no body: the call is the operation, the arguments its operands, and a consumer that traces rays reads the calls. A stub’s body is empty (a function that returns a value returns false), so nothing that runs the module as written runs the pipeline.

nameargumentsresult
TRACE_RAYacceleration structure, ray flags, instance mask, hit group offset, hit group stride, miss index, origin (vec3<f32>), t min, direction (vec3<f32>), t max, pointer to the payload
REPORT_HITt (f32), hit kind (u32), pointer to the attributeswhether the hit was accepted (bool)
CALL_SHADERshader index (u32), pointer to the parameter
IGNORE_HIT(the program ends)
ACCEPT_HIT_AND_END_SEARCH(the program ends)

Constants§

ACCEPT_HIT_AND_END_SEARCH
AcceptHitAndEndSearch: an any-hit program accepts the hit, stops the search and ends.
CALL_SHADER
CallShader: run a callable program.
IGNORE_HIT
IgnoreHit: an any-hit program rejects the candidate hit and ends.
OPERATIONS
Every operation, by name.
REPORT_HIT
ReportHit: an intersection program reports a hit at t.
TRACE_RAY
TraceRay: shoot a ray into an acceleration structure; the payload is read and written by the programs it runs.