Skip to main content

Pipeline

Struct Pipeline 

Source
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

Source

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”).

Source

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.

Source

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.

Source

pub fn with_hit_groups(self, groups: impl IntoIterator<Item = HitGroup>) -> Self

Add or replace hit groups the libraries do not state.

Source

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.

Trait Implementations§

Source§

impl Debug for Pipeline

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.