pub struct Device { /* private fields */ }Expand description
Structure describing a logical device. Some members are internally mutable, stored behind mutexes.
Implementations§
Source§impl Device
impl Device
pub fn create_blas( self: &Arc<Self>, blas_desc: &BlasDescriptor<'_>, sizes: BlasGeometrySizeDescriptors, ) -> Result<Arc<Blas>, CreateBlasError>
pub fn create_tlas( self: &Arc<Self>, desc: &TlasDescriptor<'_>, ) -> Result<Arc<Tlas>, CreateTlasError>
Source§impl Device
impl Device
Sourcepub unsafe fn start_graphics_debugger_capture(&self)
pub unsafe fn start_graphics_debugger_capture(&self)
§Safety
- See wgpu::Device::start_graphics_debugger_capture for details the safety.
Sourcepub unsafe fn stop_graphics_debugger_capture(&self)
pub unsafe fn stop_graphics_debugger_capture(&self)
§Safety
- See wgpu::Device::stop_graphics_debugger_capture for details the safety.
Source§impl Device
impl Device
pub fn late_init_resources_with_queue( self: &Arc<Self>, ) -> Result<(), RequestDeviceError>
pub fn is_valid(&self) -> bool
pub fn check_is_valid(&self) -> Result<(), DeviceError>
Sourcepub fn lose_if_oom(&self)
pub fn lose_if_oom(&self)
Checks that we are operating within the memory budget reported by the native APIs.
If we are not, the device gets invalidated.
The budget might fluctuate over the lifetime of the application, so it should be checked somewhat frequently.
pub fn handle_hal_error(&self, error: DeviceError) -> DeviceError
pub fn handle_hal_error_with_nonfatal_oom( &self, error: DeviceError, ) -> DeviceError
pub fn get_queue(&self) -> Option<Arc<Queue>>
pub fn set_queue(&self, queue: &Arc<Queue>)
pub fn poll( &self, poll_type: PollType<SubmissionIndex>, ) -> Result<PollStatus, WaitIdleError>
pub fn create_buffer( self: &Arc<Self>, desc: &BufferDescriptor<'_>, ) -> Result<Arc<Buffer>, CreateBufferError>
pub fn set_buffer_data( self: &Arc<Self>, buffer: &Arc<Buffer>, offset: BufferAddress, data: &[u8], ) -> BufferAccessResult
Available on crate feature
replay only.pub fn create_texture( self: &Arc<Self>, desc: &TextureDescriptor<'_>, ) -> Result<Arc<Texture>, CreateTextureError>
pub fn create_texture_view( self: &Arc<Self>, texture: &Arc<Texture>, desc: &TextureViewDescriptor<'_>, ) -> Result<Arc<TextureView>, CreateTextureViewError>
pub fn create_external_texture( self: &Arc<Self>, desc: &ExternalTextureDescriptor<'_>, planes: &[Arc<TextureView>], ) -> Result<Arc<ExternalTexture>, CreateExternalTextureError>
pub fn create_sampler( self: &Arc<Self>, desc: &SamplerDescriptor<'_>, ) -> Result<Arc<Sampler>, CreateSamplerError>
pub fn create_shader_module<'a>( self: &Arc<Self>, desc: &ShaderModuleDescriptor<'a>, source: ShaderModuleSource<'a>, ) -> Result<Arc<ShaderModule>, CreateShaderModuleError>
pub fn create_bind_group_layout( self: &Arc<Self>, desc: &BindGroupLayoutDescriptor<'_>, ) -> Result<Arc<BindGroupLayout>, CreateBindGroupLayoutError>
pub fn create_bind_group( self: &Arc<Self>, desc: ResolvedBindGroupDescriptor<'_>, ) -> Result<Arc<BindGroup>, CreateBindGroupError>
pub fn create_pipeline_layout( self: &Arc<Self>, desc: &ResolvedPipelineLayoutDescriptor<'_>, ) -> Result<Arc<PipelineLayout>, CreatePipelineLayoutError>
pub fn create_compute_pipeline( self: &Arc<Self>, desc: ResolvedComputePipelineDescriptor<'_>, ) -> Result<Arc<ComputePipeline>, CreateComputePipelineError>
pub fn create_render_pipeline( self: &Arc<Self>, desc: ResolvedGeneralRenderPipelineDescriptor<'_>, ) -> Result<Arc<RenderPipeline>, CreateRenderPipelineError>
Sourcepub unsafe fn create_pipeline_cache(
self: &Arc<Self>,
desc: &PipelineCacheDescriptor<'_>,
) -> Result<Arc<PipelineCache>, CreatePipelineCacheError>
pub unsafe fn create_pipeline_cache( self: &Arc<Self>, desc: &PipelineCacheDescriptor<'_>, ) -> Result<Arc<PipelineCache>, CreatePipelineCacheError>
§Safety
The data field on desc must have previously been returned from crate::global::Global::pipeline_cache_get_data
pub fn create_query_set( self: &Arc<Self>, desc: &QuerySetDescriptor<'_>, ) -> Result<Arc<QuerySet>, CreateQuerySetError>
pub fn configure_surface( self: &Arc<Self>, surface: &Surface, config: &SurfaceConfiguration<Vec<TextureFormat>>, ) -> Option<ConfigureSurfaceError>
pub fn get_hal_counters(&self) -> HalCounters
pub fn generate_allocator_report(&self) -> Option<AllocatorReport>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Device
impl !RefUnwindSafe for Device
impl Send for Device
impl Sync for Device
impl Unpin for Device
impl !UnwindSafe for Device
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more