[−][src]Struct wgpu::Device
Open connection to a graphics and/or compute device.
The Device
is the responsible for the creation of most rendering and compute resources, as
well as exposing [Queue
] objects.
A device may be requested from an adapter with [Adapter::request_device
].
Methods
impl Device
[src]
pub fn poll(&self, maintain: Maintain)
[src]
Check for resource cleanups and mapping callbacks.
no-op on the web, device is automatically polled.
pub fn extensions(&self) -> Extensions
[src]
List all extensions that may be used with this device.
Functions may panic if you use unsupported extensions.
pub fn limits(&self) -> Limits
[src]
List all limits that were requested of this device.
If any of these limits are exceeded, functions may panic.
pub fn capabilities(&self) -> Capabilities
[src]
List all capabilities that may be used wth this device.
Functions may panic if you use unsupported capabilities.
pub fn create_shader_module(&self, source: ShaderModuleSource) -> ShaderModule
[src]
Creates a shader module from either SPIR-V or WGSL source code.
pub fn create_command_encoder(
&self,
desc: &CommandEncoderDescriptor
) -> CommandEncoder
[src]
&self,
desc: &CommandEncoderDescriptor
) -> CommandEncoder
Creates an empty [CommandEncoder
].
pub fn create_render_bundle_encoder(
&self,
desc: &RenderBundleEncoderDescriptor
) -> RenderBundleEncoder
[src]
&self,
desc: &RenderBundleEncoderDescriptor
) -> RenderBundleEncoder
Creates an empty [RenderBundleEncoder
].
pub fn create_bind_group(&self, desc: &BindGroupDescriptor) -> BindGroup
[src]
Creates a new [BindGroup
].
pub fn create_bind_group_layout(
&self,
desc: &BindGroupLayoutDescriptor
) -> BindGroupLayout
[src]
&self,
desc: &BindGroupLayoutDescriptor
) -> BindGroupLayout
Creates a [BindGroupLayout
].
pub fn create_pipeline_layout(
&self,
desc: &PipelineLayoutDescriptor
) -> PipelineLayout
[src]
&self,
desc: &PipelineLayoutDescriptor
) -> PipelineLayout
Creates a [PipelineLayout
].
pub fn create_render_pipeline(
&self,
desc: &RenderPipelineDescriptor
) -> RenderPipeline
[src]
&self,
desc: &RenderPipelineDescriptor
) -> RenderPipeline
Creates a [RenderPipeline
].
pub fn create_compute_pipeline(
&self,
desc: &ComputePipelineDescriptor
) -> ComputePipeline
[src]
&self,
desc: &ComputePipelineDescriptor
) -> ComputePipeline
Creates a [ComputePipeline
].
pub fn create_buffer(&self, desc: &BufferDescriptor) -> Buffer
[src]
Creates a [Buffer
].
pub fn create_buffer_with_data(&self, data: &[u8], usage: BufferUsage) -> Buffer
[src]
Creates a new buffer, maps it into host-visible memory, copies data from the given slice,
and finally unmaps it, returning a [Buffer
].
pub fn create_texture(&self, desc: &TextureDescriptor) -> Texture
[src]
Creates a new [Texture
].
desc
specifies the general format of the texture.
pub fn create_sampler(&self, desc: &SamplerDescriptor) -> Sampler
[src]
Creates a new [Sampler
].
desc
specifies the behavior of the sampler.
pub fn create_swap_chain(
&self,
surface: &Surface,
desc: &SwapChainDescriptor
) -> SwapChain
[src]
&self,
surface: &Surface,
desc: &SwapChainDescriptor
) -> SwapChain
Create a new [SwapChain
] which targets surface
.
Panics
- A old [
SwapChainFrame
] is still alive referencing an old swapchain. - Texture format requested is unsupported on the swap chain.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Device
impl Send for Device
impl Sync for Device
impl Unpin for Device
impl !UnwindSafe for Device
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,