Struct nannou::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]
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]
List all features that may be used with this device.
Functions may panic if you use unsupported features.
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]
&self,
desc: &ShaderModuleDescriptor<'_>
) -> ShaderModule
Creates a shader module from either SPIR-V or WGSL source code.
pub fn create_command_encoder(
&self,
desc: &CommandEncoderDescriptor<Option<&str>>
) -> CommandEncoder
[src]
&self,
desc: &CommandEncoderDescriptor<Option<&str>>
) -> 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<Option<&str>>) -> Buffer
[src]
Creates a Buffer
.
pub fn create_texture(&self, desc: &TextureDescriptor<Option<&str>>) -> 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_query_set(&self, desc: &QuerySetDescriptor) -> QuerySet
[src]
Creates a new QuerySet
.
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.
pub fn on_uncaptured_error(&self, handler: impl UncapturedErrorHandler)
[src]
Set a callback for errors that are not handled in error scopes.
Trait Implementations
impl Debug for Device
[src]
impl DeviceExt for Device
[src]
pub fn create_buffer_init(
&self,
descriptor: &BufferInitDescriptor<'_>
) -> Buffer
[src]
&self,
descriptor: &BufferInitDescriptor<'_>
) -> Buffer
pub fn create_texture_with_data(
&self,
queue: &Queue,
desc: &TextureDescriptor<Option<&str>>,
data: &[u8]
) -> Texture
[src]
&self,
queue: &Queue,
desc: &TextureDescriptor<Option<&str>>,
data: &[u8]
) -> Texture
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<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
T: Component + Float,
D: AdaptFrom<S, Swp, Dwp, T>,
Swp: WhitePoint,
Dwp: WhitePoint,
[src]
T: Component + Float,
D: AdaptFrom<S, Swp, Dwp, T>,
Swp: WhitePoint,
Dwp: WhitePoint,
pub fn adapt_into_using<M>(self, method: M) -> D where
M: TransformMatrix<Swp, Dwp, T>,
[src]
M: TransformMatrix<Swp, Dwp, T>,
pub fn adapt_into(self) -> D
[src]
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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> ConvertInto<U> for T where
U: ConvertFrom<T>,
[src]
U: ConvertFrom<T>,
pub fn convert_into(self) -> U
[src]
pub fn convert_unclamped_into(self) -> U
[src]
pub fn try_convert_into(self) -> Result<U, OutOfBounds<U>>
[src]
impl<T> Downcast<T> for T
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> SetParameter for T
pub fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
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.
pub 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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Upcast<T> for T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,