pub struct RayTracingPass<'encoder> {
pub(crate) inner: DispatchRayTracingPass,
pub(crate) actions: Arc<Mutex<DeferredCommandBufferActions>>,
pub(crate) _encoder_guard: PhantomDrop<&'encoder ()>,
}Expand description
In-progress recording of a ray tracing pass.
It can be created with CommandEncoder::begin_ray_tracing_pass.
Fields§
§inner: DispatchRayTracingPass§actions: Arc<Mutex<DeferredCommandBufferActions>>Shared with CommandEncoder to enqueue deferred actions from within a pass.
_encoder_guard: PhantomDrop<&'encoder ()>This lifetime is used to protect the CommandEncoder from being used
while the pass is alive. This needs to be PhantomDrop to prevent the lifetime
from being shortened.
Implementations§
Source§impl RayTracingPass<'_>
impl RayTracingPass<'_>
Sourcepub fn forget_lifetime(self) -> RayTracingPass<'static>
pub fn forget_lifetime(self) -> RayTracingPass<'static>
Drops the lifetime relationship to the parent command encoder, making usage of the encoder while this pass is recorded a run-time error instead.
Attention: As long as the ray tracing pass has not been ended, any mutating operation on the parent command encoder will cause a run-time error and invalidate it! By default, the lifetime constraint prevents this, but it can be useful to handle this at run time, such as when storing the pass and encoder in the same data structure.
This operation has no effect on pass recording.
It’s a safe operation, since CommandEncoder is in a locked state as long as the pass is active
regardless of the lifetime constraint or its absence.
Sourcepub fn set_pipeline(&mut self, pipeline: &RayTracingPipeline)
pub fn set_pipeline(&mut self, pipeline: &RayTracingPipeline)
Sets the active ray tracing pipeline.
Sourcepub fn set_bind_group<'a, BG>(
&mut self,
index: u32,
bind_group: BG,
offsets: &[DynamicOffset],
)
pub fn set_bind_group<'a, BG>( &mut self, index: u32, bind_group: BG, offsets: &[DynamicOffset], )
Sets the active bind group for a given bind group index. The bind group layout
in the active pipeline when the trace_rays() function is called must match the layout of this bind group.
If the bind group have dynamic offsets, provide them in the binding order.
These offsets have to be aligned to Limits::min_uniform_buffer_offset_alignment
or Limits::min_storage_buffer_offset_alignment appropriately.
Sourcepub fn insert_debug_marker(&mut self, label: &str)
pub fn insert_debug_marker(&mut self, label: &str)
Inserts debug marker.
Sourcepub fn push_debug_group(&mut self, label: &str)
pub fn push_debug_group(&mut self, label: &str)
Start record commands and group it into debug marker group.
Sourcepub fn pop_debug_group(&mut self)
pub fn pop_debug_group(&mut self)
Stops command recording and creates debug group.
Sourcepub fn trace_rays(&mut self, x: u32, y: u32, z: u32)
pub fn trace_rays(&mut self, x: u32, y: u32, z: u32)
Dispatches rays in the current ray tracing pipeline.
Source§impl RayTracingPass<'_>
Features::IMMEDIATES must be enabled on the device in order to call these functions.
impl RayTracingPass<'_>
Features::IMMEDIATES must be enabled on the device in order to call these functions.
Sourcepub fn set_immediates(&mut self, offset: u32, data: &[u8])
pub fn set_immediates(&mut self, offset: u32, data: &[u8])
Set immediate data for subsequent RayTracingPass::trace_rays calls.
Write the bytes in data at offset offset within immediate data
storage. Both offset and the length of data must be
multiples of crate::IMMEDIATE_DATA_ALIGNMENT, which is always 4.
For example, if offset is 4 and data is eight bytes long, this
call will write data to bytes 4..12 of immediate data storage.
Trait Implementations§
Source§impl<'encoder> Debug for RayTracingPass<'encoder>
impl<'encoder> Debug for RayTracingPass<'encoder>
Source§impl Hash for RayTracingPass<'_>
impl Hash for RayTracingPass<'_>
Source§impl Ord for RayTracingPass<'_>
impl Ord for RayTracingPass<'_>
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for RayTracingPass<'_>
impl PartialEq for RayTracingPass<'_>
Source§impl PartialOrd for RayTracingPass<'_>
impl PartialOrd for RayTracingPass<'_>
impl Eq for RayTracingPass<'_>
Auto Trait Implementations§
impl<'encoder> Freeze for RayTracingPass<'encoder>
impl<'encoder> !RefUnwindSafe for RayTracingPass<'encoder>
impl<'encoder> Send for RayTracingPass<'encoder>
impl<'encoder> Sync for RayTracingPass<'encoder>
impl<'encoder> Unpin for RayTracingPass<'encoder>
impl<'encoder> UnsafeUnpin for RayTracingPass<'encoder>
impl<'encoder> !UnwindSafe for RayTracingPass<'encoder>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more