pub struct Pipeline { /* private fields */ }Expand description
A ray tracing pipeline: the programs of a library, its hit groups and the application’s shader table.
Implementations§
Source§impl Pipeline
impl Pipeline
Sourcepub fn new(programs: Vec<Program>, table: ShaderTable) -> Result<Self, String>
pub fn new(programs: Vec<Program>, table: ShaderTable) -> Result<Self, String>
A pipeline of programs (each a ray tracing program, named by its export), the hit groups the programs’
libraries state, and table. The pipeline’s maximum recursion depth is the one a library’s pipeline config
subobject states; libraries that state none leave it to Pipeline::with_max_recursion, and a dispatch
without one is refused (the DXR specification: “A raytracing pipeline needs one raytracing pipeline
configuration”, section “D3D12_RAYTRACING_PIPELINE_CONFIG”).
Sourcepub fn with_max_recursion(self, depth: u32) -> Self
pub fn with_max_recursion(self, depth: u32) -> Self
State the maximum recursion depth, the pipeline config an application gives when its libraries do not (the
depth the application declares in D3D12_RAYTRACING_PIPELINE_CONFIG): replaces the libraries’ own.
Sourcepub fn with_pipeline_flags(self, flags: u32) -> Self
pub fn with_pipeline_flags(self, flags: u32) -> Self
State the pipeline flags (D3D12_RAYTRACING_PIPELINE_CONFIG1‘s Flags: the SKIP_TRIANGLES and
SKIP_PROCEDURAL ray flags), as an application gives them when its libraries state none: replaces the
libraries’ own.
Sourcepub fn with_hit_groups(self, groups: impl IntoIterator<Item = HitGroup>) -> Self
pub fn with_hit_groups(self, groups: impl IntoIterator<Item = HitGroup>) -> Self
Add or replace hit groups the libraries do not state.
Sourcepub fn dispatch_rays(
&self,
raygen: &str,
dimensions: [u32; 3],
resources: &PipelineResources,
sampler: &mut dyn Sampler,
) -> Result<DispatchStats, String>
pub fn dispatch_rays( &self, raygen: &str, dimensions: [u32; 3], resources: &PipelineResources, sampler: &mut dyn Sampler, ) -> Result<DispatchStats, String>
Run the ray generation program raygen at every position of dimensions, x fastest. Image writes and buffer
access go to sampler by bind slot (the register), as for a pixel program.