Struct wgpu::Device [−][src]
pub struct Device { /* fields omitted */ }
Open connection to a graphics and/or compute device.
Responsible for the creation of most rendering and compute resources.
These are then used in commands, which are submitted to a Queue
.
A device may be requested from an adapter with Adapter::request_device
.
Implementations
impl Device
[src]
impl Device
[src]pub fn poll(&self, maintain: Maintain)
[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 features(&self) -> Features
[src]
pub fn features(&self) -> Features
[src]List all features that may be used with this device.
Functions may panic if you use unsupported features.
pub fn limits(&self) -> Limits
[src]
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 create_shader_module(
&self,
desc: &ShaderModuleDescriptor<'_>
) -> ShaderModule
[src]
pub fn create_shader_module(
&self,
desc: &ShaderModuleDescriptor<'_>
) -> ShaderModule
[src]Creates a shader module from either SPIR-V or WGSL source code.
pub fn create_command_encoder(
&self,
desc: &CommandEncoderDescriptor<'_>
) -> CommandEncoder
[src]
pub fn create_command_encoder(
&self,
desc: &CommandEncoderDescriptor<'_>
) -> CommandEncoder
[src]Creates an empty CommandEncoder
.
pub fn create_render_bundle_encoder(
&self,
desc: &RenderBundleEncoderDescriptor<'_>
) -> RenderBundleEncoder<'_>
[src]
pub fn create_render_bundle_encoder(
&self,
desc: &RenderBundleEncoderDescriptor<'_>
) -> RenderBundleEncoder<'_>
[src]Creates an empty RenderBundleEncoder
.
pub fn create_bind_group(&self, desc: &BindGroupDescriptor<'_>) -> BindGroup
[src]
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]
pub fn create_bind_group_layout(
&self,
desc: &BindGroupLayoutDescriptor<'_>
) -> BindGroupLayout
[src]Creates a BindGroupLayout
.
pub fn create_pipeline_layout(
&self,
desc: &PipelineLayoutDescriptor<'_>
) -> PipelineLayout
[src]
pub fn create_pipeline_layout(
&self,
desc: &PipelineLayoutDescriptor<'_>
) -> PipelineLayout
[src]Creates a PipelineLayout
.
pub fn create_render_pipeline(
&self,
desc: &RenderPipelineDescriptor<'_>
) -> RenderPipeline
[src]
pub fn create_render_pipeline(
&self,
desc: &RenderPipelineDescriptor<'_>
) -> RenderPipeline
[src]Creates a RenderPipeline
.
pub fn create_compute_pipeline(
&self,
desc: &ComputePipelineDescriptor<'_>
) -> ComputePipeline
[src]
pub fn create_compute_pipeline(
&self,
desc: &ComputePipelineDescriptor<'_>
) -> ComputePipeline
[src]Creates a ComputePipeline
.
pub fn create_buffer(&self, desc: &BufferDescriptor<'_>) -> Buffer
[src]
pub fn create_buffer(&self, desc: &BufferDescriptor<'_>) -> Buffer
[src]Creates a Buffer
.
pub fn create_texture(&self, desc: &TextureDescriptor<'_>) -> Texture
[src]
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]
pub fn create_sampler(&self, desc: &SamplerDescriptor<'_>) -> Sampler
[src]Creates a new Sampler
.
desc
specifies the behavior of the sampler.
pub fn create_query_set(&self, desc: &QuerySetDescriptor) -> QuerySet
[src]
pub fn create_query_set(&self, desc: &QuerySetDescriptor) -> QuerySet
[src]Creates a new QuerySet
.
pub fn create_swap_chain(
&self,
surface: &Surface,
desc: &SwapChainDescriptor
) -> SwapChain
[src]
pub fn create_swap_chain(
&self,
surface: &Surface,
desc: &SwapChainDescriptor
) -> SwapChain
[src]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.
pub fn on_uncaptured_error(&self, handler: impl UncapturedErrorHandler)
[src]
pub fn on_uncaptured_error(&self, handler: impl UncapturedErrorHandler)
[src]Set a callback for errors that are not handled in error scopes.
pub fn start_capture(&self)
[src]
pub fn start_capture(&self)
[src]Starts frame capture.
pub fn stop_capture(&self)
[src]
pub fn stop_capture(&self)
[src]Stops frame capture.
Trait Implementations
impl DeviceExt for Device
[src]
impl DeviceExt for Device
[src]fn create_buffer_init(&self, descriptor: &BufferInitDescriptor<'_>) -> Buffer
[src]
fn create_buffer_init(&self, descriptor: &BufferInitDescriptor<'_>) -> Buffer
[src]Creates a Buffer with data to initialize it.
fn create_texture_with_data(
&self,
queue: &Queue,
desc: &TextureDescriptor<'_>,
data: &[u8]
) -> Texture
[src]
fn create_texture_with_data(
&self,
queue: &Queue,
desc: &TextureDescriptor<'_>,
data: &[u8]
) -> Texture
[src]Upload an entire texture and its mipmaps from a source buffer. Read more
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> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more