pub struct Scanner { /* private fields */ }Expand description
Performs inclusive and exclusive unsigned 32-bit prefix scans on a wgpu device.
Implementations§
Source§impl Scanner
impl Scanner
Sourcepub fn new(device: &Device, queue: &Queue) -> Self
pub fn new(device: &Device, queue: &Queue) -> Self
Creates a scanner that submits work through an existing wgpu device and queue.
Sourcepub fn from_context(ctx: &Context) -> Self
pub fn from_context(ctx: &Context) -> Self
Creates a scanner from the crate’s optional convenience context.
Sourcepub async fn scan(&mut self, input: &[u32]) -> Result<Vec<u32>, Error>
pub async fn scan(&mut self, input: &[u32]) -> Result<Vec<u32>, Error>
Uploads values, scans them on the GPU, and downloads the inclusive prefixes.
Sourcepub async fn scan_exclusive(&mut self, input: &[u32]) -> Result<Vec<u32>, Error>
pub async fn scan_exclusive(&mut self, input: &[u32]) -> Result<Vec<u32>, Error>
Uploads values, scans them on the GPU, and downloads the exclusive prefixes.
Sourcepub fn scan_gpu_to_gpu(
&mut self,
input_buf: &Buffer,
output_buf: &Buffer,
num_items: u32,
) -> Result<(), Error>
pub fn scan_gpu_to_gpu( &mut self, input_buf: &Buffer, output_buf: &Buffer, num_items: u32, ) -> Result<(), Error>
Scans caller-owned GPU buffers and submits the work immediately.
Sourcepub fn scan_exclusive_gpu_to_gpu(
&mut self,
input_buf: &Buffer,
output_buf: &Buffer,
num_items: u32,
) -> Result<(), Error>
pub fn scan_exclusive_gpu_to_gpu( &mut self, input_buf: &Buffer, output_buf: &Buffer, num_items: u32, ) -> Result<(), Error>
Exclusively scans caller-owned GPU buffers and submits the work immediately.
Sourcepub fn record_scan(
&mut self,
encoder: &mut CommandEncoder,
input_buf: &Buffer,
output_buf: &Buffer,
num_items: u32,
) -> Result<(), Error>
pub fn record_scan( &mut self, encoder: &mut CommandEncoder, input_buf: &Buffer, output_buf: &Buffer, num_items: u32, ) -> Result<(), Error>
Records a GPU prefix scan without submitting or waiting for the work.
Sourcepub fn record_exclusive_scan(
&mut self,
encoder: &mut CommandEncoder,
input_buf: &Buffer,
output_buf: &Buffer,
num_items: u32,
) -> Result<(), Error>
pub fn record_exclusive_scan( &mut self, encoder: &mut CommandEncoder, input_buf: &Buffer, output_buf: &Buffer, num_items: u32, ) -> Result<(), Error>
Records an exclusive GPU prefix scan without submitting or waiting for the work.
Auto Trait Implementations§
impl !RefUnwindSafe for Scanner
impl !UnwindSafe for Scanner
impl Freeze for Scanner
impl Send for Scanner
impl Sync for Scanner
impl Unpin for Scanner
impl UnsafeUnpin for Scanner
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
Mutably borrows from an owned value. Read more