pub struct WgpuRuntime { /* private fields */ }Expand description
Headless wgpu runtime for compute-only workloads.
Implementations§
Source§impl WgpuRuntime
impl WgpuRuntime
Sourcepub fn new_headless() -> SpatialResult<Self>
pub fn new_headless() -> SpatialResult<Self>
Creates a headless wgpu runtime preferring a high-performance adapter.
Prefer Self::shared when running multiple GPU filters in one process.
Sourcepub fn new_headless_with_preference(
preference: WgpuPowerPreference,
) -> SpatialResult<Self>
pub fn new_headless_with_preference( preference: WgpuPowerPreference, ) -> SpatialResult<Self>
Creates a headless wgpu runtime with an explicit adapter power preference.
Returns a process-wide shared headless runtime, initializing it on first use.
Sourcepub const fn adapter_info(&self) -> &WgpuAdapterInfo
pub const fn adapter_info(&self) -> &WgpuAdapterInfo
Returns the selected adapter/backend receipt.
Sourcepub fn wait_idle(&self)
pub fn wait_idle(&self)
Blocks until all previously submitted work on this device is complete.
Normal device-resident chains do not synchronize implicitly. This is an explicit profiling/testing boundary or host-coordination primitive.
Sourcepub fn cached_image_texture_count(&self) -> usize
pub fn cached_image_texture_count(&self) -> usize
Returns the number of image textures retained for steady-state reuse.
Sourcepub fn initialized_image_pipeline_count(&self) -> usize
pub fn initialized_image_pipeline_count(&self) -> usize
Returns the number of initialized GPU image pipeline families.
Sourcepub fn pipelines(&self) -> &ComputePipelineCache
pub fn pipelines(&self) -> &ComputePipelineCache
Returns cached compute pipelines for this runtime’s device.
Sourcepub fn max_gather_channels(&self) -> u32
pub fn max_gather_channels(&self) -> u32
Returns the maximum attribute channels gatherable in one multi dispatch.
Sourcepub fn buffer_pool(&self) -> &GpuBufferPool
pub fn buffer_pool(&self) -> &GpuBufferPool
Returns the reusable storage-buffer pool owned by this runtime.
Sourcepub fn upload_pod_storage<T: Pod>(
&self,
label: &'static str,
data: &[T],
) -> SpatialResult<Buffer>
pub fn upload_pod_storage<T: Pod>( &self, label: &'static str, data: &[T], ) -> SpatialResult<Buffer>
Uploads a POD slice into a reusable pooled storage buffer.
Sourcepub fn upload_f32_storage(
&self,
label: &'static str,
data: &[f32],
) -> SpatialResult<Buffer>
pub fn upload_f32_storage( &self, label: &'static str, data: &[f32], ) -> SpatialResult<Buffer>
Uploads f32 values into a reusable pooled storage buffer.
Sourcepub fn upload_u32_storage(
&self,
label: &'static str,
data: &[u32],
) -> SpatialResult<Buffer>
pub fn upload_u32_storage( &self, label: &'static str, data: &[u32], ) -> SpatialResult<Buffer>
Uploads u32 values into a reusable pooled storage buffer.
Sourcepub fn recycle_storage(&self, byte_len: u64, buffer: Buffer)
pub fn recycle_storage(&self, byte_len: u64, buffer: Buffer)
Returns a storage buffer to the upload pool for reuse.
Sourcepub fn clear_buffer_pool(&self)
pub fn clear_buffer_pool(&self)
Clears all buffers cached in the upload pool.
Sourcepub async fn new_headless_async(
preference: WgpuPowerPreference,
) -> SpatialResult<Self>
pub async fn new_headless_async( preference: WgpuPowerPreference, ) -> SpatialResult<Self>
Creates a headless runtime asynchronously.
This is the browser/WebGPU construction path because blocking a WASM main thread is not supported. Native callers may also use it from their async executor.
Trait Implementations§
Source§impl SpatialRuntime for WgpuRuntime
Available on crate feature gpu-wgpu only.
impl SpatialRuntime for WgpuRuntime
gpu-wgpu only.