pub struct TlasPackage { /* private fields */ }
unstable-wgpu-24
only.Expand description
The safe version of TlasEntry, containing TlasInstances instead of a raw buffer.
Implementations§
Source§impl TlasPackage
impl TlasPackage
Sourcepub fn new(tlas: Tlas) -> TlasPackage
pub fn new(tlas: Tlas) -> TlasPackage
Construct TlasPackage consuming the Tlas (prevents modification of the Tlas without using this package).
Sourcepub fn new_with_instances(
tlas: Tlas,
instances: Vec<Option<TlasInstance>>,
) -> TlasPackage
pub fn new_with_instances( tlas: Tlas, instances: Vec<Option<TlasInstance>>, ) -> TlasPackage
Construct TlasPackage consuming the Tlas (prevents modification of the Tlas without using this package). This constructor moves the instances into the package (the number of instances needs to fit into tlas, otherwise when building a validation error will be raised).
Sourcepub fn get(&self) -> &[Option<TlasInstance>]
pub fn get(&self) -> &[Option<TlasInstance>]
Get a reference to all instances.
Sourcepub fn get_mut_slice(
&mut self,
range: Range<usize>,
) -> Option<&mut [Option<TlasInstance>]>
pub fn get_mut_slice( &mut self, range: Range<usize>, ) -> Option<&mut [Option<TlasInstance>]>
Get a mutable slice to a range of instances. Returns None if the range is out of bounds. All elements from the lowest accessed index up are marked as modified. For best performance it is recommended to prefer access to low elements and modify higher elements as little as possible. This can be done by ordering instances from the most to the least used. It is recommended to use Self::index_mut unless the option if out of bounds is required
Sourcepub fn get_mut_single(
&mut self,
index: usize,
) -> Option<&mut Option<TlasInstance>>
pub fn get_mut_single( &mut self, index: usize, ) -> Option<&mut Option<TlasInstance>>
Get a single mutable reference to an instance. Returns None if the range is out of bounds. All elements from the lowest accessed index up are marked as modified. For best performance it is recommended to prefer access to low elements and modify higher elements as little as possible. This can be done by ordering instances from the most to the least used. It is recommended to use Self::index_mut unless the option if out of bounds is required
Sourcepub fn as_binding(&self) -> BindingResource<'_>
pub fn as_binding(&self) -> BindingResource<'_>
Get the binding resource for the underling acceleration structure, to be used when creating a BindGroup
Trait Implementations§
Source§impl Index<usize> for TlasPackage
impl Index<usize> for TlasPackage
Auto Trait Implementations§
impl Freeze for TlasPackage
impl !RefUnwindSafe for TlasPackage
impl Send for TlasPackage
impl Sync for TlasPackage
impl Unpin for TlasPackage
impl !UnwindSafe for TlasPackage
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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