Struct wgpu::Device [−][src]
pub struct Device { /* fields omitted */ }
Expand description
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
Check for resource cleanups and mapping callbacks.
no-op on the web, device is automatically polled.
List all features that may be used with this device.
Functions may panic if you use unsupported features.
List all limits that were requested of this device.
If any of these limits are exceeded, functions may panic.
Creates a shader module from either SPIR-V or WGSL source code.
pub unsafe fn create_shader_module_spirv(
&self,
desc: &ShaderModuleDescriptorSpirV<'_>
) -> ShaderModule
pub unsafe fn create_shader_module_spirv(
&self,
desc: &ShaderModuleDescriptorSpirV<'_>
) -> ShaderModule
Creates a shader module from SPIR-V binary directly.
Safety
This function passes binary data to the backend as-is and can potentially result in a driver crash or bogus behaviour. No attempt is made to ensure that data is valid SPIR-V.
See also include_spirv_raw!
and util::make_spirv_raw
.
Creates an empty CommandEncoder
.
pub fn create_render_bundle_encoder(
&self,
desc: &RenderBundleEncoderDescriptor<'_>
) -> RenderBundleEncoder<'_>
pub fn create_render_bundle_encoder(
&self,
desc: &RenderBundleEncoderDescriptor<'_>
) -> RenderBundleEncoder<'_>
Creates an empty RenderBundleEncoder
.
Creates a new BindGroup
.
pub fn create_bind_group_layout(
&self,
desc: &BindGroupLayoutDescriptor<'_>
) -> BindGroupLayout
pub fn create_bind_group_layout(
&self,
desc: &BindGroupLayoutDescriptor<'_>
) -> BindGroupLayout
Creates a BindGroupLayout
.
Creates a PipelineLayout
.
Creates a RenderPipeline
.
pub fn create_compute_pipeline(
&self,
desc: &ComputePipelineDescriptor<'_>
) -> ComputePipeline
pub fn create_compute_pipeline(
&self,
desc: &ComputePipelineDescriptor<'_>
) -> ComputePipeline
Creates a ComputePipeline
.
Creates a Buffer
.
Creates a new Texture
.
desc
specifies the general format of the texture.
pub unsafe fn create_texture_from_hal<A: HalApi>(
&self,
hal_texture: A::Texture,
desc: &TextureDescriptor<'_>
) -> Texture
pub unsafe fn create_texture_from_hal<A: HalApi>(
&self,
hal_texture: A::Texture,
desc: &TextureDescriptor<'_>
) -> Texture
Creates a new Sampler
.
desc
specifies the behavior of the sampler.
Creates a new QuerySet
.
Set a callback for errors that are not handled in error scopes.
Starts frame capture.
Stops frame capture.
Trait Implementations
Creates a Buffer with data to initialize it.
fn create_texture_with_data(
&self,
queue: &Queue,
desc: &TextureDescriptor<'_>,
data: &[u8]
) -> Texture
fn create_texture_with_data(
&self,
queue: &Queue,
desc: &TextureDescriptor<'_>,
data: &[u8]
) -> Texture
Upload an entire texture and its mipmaps from a source buffer. Read more