[][src]Struct wgpu::Device

pub struct Device { /* fields omitted */ }

An 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.


impl Device[src]

pub fn poll(&self, maintain: Maintain)[src]

Check for resource cleanups and mapping callbacks.

pub fn create_shader_module(&self, spv: &[u32]) -> ShaderModule[src]

Creates a shader module from SPIR-V source code.

pub fn create_command_encoder(
    desc: &CommandEncoderDescriptor
) -> CommandEncoder

Creates an empty CommandEncoder.

pub fn create_bind_group(&self, desc: &BindGroupDescriptor) -> BindGroup[src]

Creates a new bind group.

pub fn create_bind_group_layout(
    desc: &BindGroupLayoutDescriptor
) -> BindGroupLayout

Creates a bind group layout.

pub fn create_pipeline_layout(
    desc: &PipelineLayoutDescriptor
) -> PipelineLayout

Creates a pipeline layout.

pub fn create_render_pipeline(
    desc: &RenderPipelineDescriptor
) -> RenderPipeline

Creates a render pipeline.

pub fn create_compute_pipeline(
    desc: &ComputePipelineDescriptor
) -> ComputePipeline

Creates a compute pipeline.

pub fn create_buffer(&self, desc: &BufferDescriptor) -> Buffer[src]

Creates a new buffer.

pub fn create_buffer_mapped(
    desc: &BufferDescriptor
) -> CreateBufferMapped

Creates a new buffer and maps it into host-visible memory.

This returns a CreateBufferMapped, which exposes a &mut [u8]. The actual Buffer will not be created until calling CreateBufferMapped::finish.

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(
    surface: &Surface,
    desc: &SwapChainDescriptor
) -> SwapChain

Create a new SwapChain which targets surface.

Trait Implementations

impl Debug for Device[src]

impl Drop for Device[src]

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

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.