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 late_init_resources_with_queue(&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>)
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 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§
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