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 async fn profile_scan_gpu_to_gpu(
&mut self,
input_buf: &Buffer,
output_buf: &Buffer,
num_items: u32,
) -> Result<GpuProfile, Error>
pub async fn profile_scan_gpu_to_gpu( &mut self, input_buf: &Buffer, output_buf: &Buffer, num_items: u32, ) -> Result<GpuProfile, Error>
Profiles an inclusive scan of caller-owned GPU buffers using GPU timestamps.
Sourcepub async fn profile_exclusive_scan_gpu_to_gpu(
&mut self,
input_buf: &Buffer,
output_buf: &Buffer,
num_items: u32,
) -> Result<GpuProfile, Error>
pub async fn profile_exclusive_scan_gpu_to_gpu( &mut self, input_buf: &Buffer, output_buf: &Buffer, num_items: u32, ) -> Result<GpuProfile, Error>
Profiles an exclusive scan of caller-owned GPU buffers using GPU timestamps.
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.