pub struct Blas {
pub(crate) handle: Option<u64>,
pub(crate) inner: DispatchBlas,
}
Expand description
Bottom Level Acceleration Structure (BLAS).
A BLAS is a device-specific raytracing acceleration structure that contains geometry data.
These BLASes are combined with transform in a TlasInstance to create a Tlas.
Fields§
§handle: Option<u64>
§inner: DispatchBlas
Implementations§
Source§impl Blas
impl Blas
Sourcepub fn handle(&self) -> Option<u64>
pub fn handle(&self) -> Option<u64>
Raw handle to the acceleration structure, used inside raw instance buffers.
Sourcepub unsafe fn as_hal<A: HalApi, F: FnOnce(Option<&A::AccelerationStructure>) -> R, R>(
&mut self,
hal_blas_callback: F,
) -> R
Available on wgpu_core
only.
pub unsafe fn as_hal<A: HalApi, F: FnOnce(Option<&A::AccelerationStructure>) -> R, R>( &mut self, hal_blas_callback: F, ) -> R
wgpu_core
only.Returns the inner hal Acceleration Structure using a callback. The hal acceleration structure
will be None
if the backend type argument does not match with this wgpu Blas
This method will start the wgpu_core level command recording.
§Safety
- The raw handle obtained from the hal Acceleration Structure must not be manually destroyed
Sourcepub fn as_custom<T: BlasInterface>(&self) -> Option<&T>
Available on custom
only.
pub fn as_custom<T: BlasInterface>(&self) -> Option<&T>
custom
only.Returns custom implementation of Blas (if custom backend and is internally T)
Source§impl Blas
impl Blas
Sourcepub fn prepare_compaction_async(
&self,
callback: impl FnOnce(Result<(), BlasAsyncError>) + WasmNotSend + 'static,
)
pub fn prepare_compaction_async( &self, callback: impl FnOnce(Result<(), BlasAsyncError>) + WasmNotSend + 'static, )
Asynchronously prepares this BLAS for compaction. The callback is called once all builds
using this BLAS are finished and the BLAS is compactable. This can be checked using
Blas::ready_for_compaction
. Rebuilding this BLAS will reset its compacted state, and it
will need to be prepared again.
§Interaction with other functions
On native, queue.submit(..)
and polling devices (that is calling instance.poll_all
or
device.poll
) with PollType::Poll
may call the callback. On native, polling devices with
PollType::Wait
(or PollType::WaitForSubmissionIndex
with a submission index greater
than the last submit the BLAS was used in) will guarantee callback is called.
Sourcepub fn ready_for_compaction(&self) -> bool
pub fn ready_for_compaction(&self) -> bool
Checks whether this BLAS is ready for compaction. The returned value is true
if
Blas::prepare_compaction_async
’s callback was called with a non-error value, otherwise
this is false
.
Trait Implementations§
Source§impl Ord for Blas
impl Ord for Blas
Source§impl PartialOrd for Blas
impl PartialOrd for Blas
impl Eq for Blas
Auto Trait Implementations§
impl Freeze for Blas
impl !RefUnwindSafe for Blas
impl Send for Blas
impl Sync for Blas
impl Unpin for Blas
impl !UnwindSafe for Blas
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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
key
and return true
if they are equal.