pub struct Device<A: HalApi> { /* private fields */ }
Expand description
Structure describing a logical device. Some members are internally mutable, stored behind mutexes.
TODO: establish clear order of locking for these:
mem_allocator
, desc_allocator
, life_tracker
, trackers
,
render_passes
, pending_writes
, trace
.
Currently, the rules are:
life_tracker
is locked afterhub.devices
, enforced by the type systemself.trackers
is locked last (unenforced)self.trace
is locked last (unenforced)
Implementations§
source§impl<A: HalApi> Device<A>
impl<A: HalApi> Device<A>
pub fn create_buffer_from_hal( &self, hal_buffer: A::Buffer, self_id: DeviceId, desc: &BufferDescriptor<'_> ) -> Buffer<A>
Trait Implementations§
impl<A: HalApi> Access<BindGroup<A>> for Device<A>
impl<A: HalApi> Access<BindGroupLayout<A>> for Device<A>
impl<A: HalApi> Access<Buffer<A>> for Device<A>
impl<A: HalApi> Access<CommandBuffer<A>> for Device<A>
impl<A: HalApi> Access<ComputePipeline<A>> for Device<A>
impl<A: HalApi> Access<Device<A>> for Adapter<A>
impl<A: HalApi> Access<Device<A>> for Root
impl<A: HalApi> Access<Device<A>> for Surface
impl<A: HalApi> Access<PipelineLayout<A>> for Device<A>
impl<A: HalApi> Access<QuerySet<A>> for Device<A>
impl<A: HalApi> Access<RenderBundle<A>> for Device<A>
impl<A: HalApi> Access<RenderPipeline<A>> for Device<A>
impl<A: HalApi> Access<Sampler<A>> for Device<A>
impl<A: HalApi> Access<ShaderModule<A>> for Device<A>
impl<A: HalApi> Access<StagingBuffer<A>> for Device<A>
impl<A: HalApi> Access<Texture<A>> for Device<A>
impl<A: HalApi> Access<TextureView<A>> for Device<A>
Auto Trait Implementations§
impl<A> !RefUnwindSafe for Device<A>
impl<A> Send for Device<A>where
A: Send,
impl<A> Sync for Device<A>where
A: Send,
impl<A> Unpin for Device<A>where
A: Unpin,
<A as Api>::BindGroup: Unpin,
<A as Api>::BindGroupLayout: Unpin,
<A as Api>::Buffer: Unpin,
<A as Api>::CommandBuffer: Unpin,
<A as Api>::CommandEncoder: Unpin,
<A as Api>::ComputePipeline: Unpin,
<A as Api>::Device: Unpin,
<A as Api>::Fence: Unpin,
<A as Api>::PipelineLayout: Unpin,
<A as Api>::QuerySet: Unpin,
<A as Api>::Queue: Unpin,
<A as Api>::RenderPipeline: Unpin,
<A as Api>::Sampler: Unpin,
<A as Api>::Texture: Unpin,
<A as Api>::TextureView: Unpin,
impl<A> !UnwindSafe for Device<A>
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