Struct wgpu::TlasPackage
source · pub struct TlasPackage { /* private fields */ }
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) -> Self
pub fn new(tlas: Tlas) -> Self
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>>
) -> Self
pub fn new_with_instances( tlas: Tlas, instances: Vec<Option<TlasInstance>> ) -> Self
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