Struct comfy::wgpu_types::SurfaceConfiguration
#[repr(C)]pub struct SurfaceConfiguration<V> {
pub usage: TextureUsages,
pub format: TextureFormat,
pub width: u32,
pub height: u32,
pub present_mode: PresentMode,
pub alpha_mode: CompositeAlphaMode,
pub view_formats: V,
}Expand description
Configures a Surface for presentation.
Fields§
§usage: TextureUsagesThe usage of the swap chain. The only supported usage is RENDER_ATTACHMENT.
format: TextureFormatThe texture format of the swap chain. The only formats that are guaranteed are
Bgra8Unorm and Bgra8UnormSrgb
width: u32Width of the swap chain. Must be the same size as the surface.
height: u32Height of the swap chain. Must be the same size as the surface.
present_mode: PresentModePresentation mode of the swap chain. Fifo is the only mode guaranteed to be supported. FifoRelaxed, Immediate, and Mailbox will crash if unsupported, while AutoVsync and AutoNoVsync will gracefully do a designed sets of fallbacks if their primary modes are unsupported.
alpha_mode: CompositeAlphaModeSpecifies how the alpha channel of the textures should be handled during compositing.
view_formats: VSpecifies what view formats will be allowed when calling create_view() on texture returned by get_current_texture().
View formats of the same format as the texture are always allowed.
Note: currently, only the srgb-ness is allowed to change. (ex: Rgba8Unorm texture + Rgba8UnormSrgb view)
Implementations§
§impl<V> SurfaceConfiguration<V>where
V: Clone,
impl<V> SurfaceConfiguration<V>where
V: Clone,
pub fn map_view_formats<M>(
&self,
fun: impl FnOnce(V) -> M
) -> SurfaceConfiguration<M>
pub fn map_view_formats<M>( &self, fun: impl FnOnce(V) -> M ) -> SurfaceConfiguration<M>
Map view_formats of the texture descriptor into another.
Trait Implementations§
§impl<V> Clone for SurfaceConfiguration<V>where
V: Clone,
impl<V> Clone for SurfaceConfiguration<V>where
V: Clone,
§fn clone(&self) -> SurfaceConfiguration<V>
fn clone(&self) -> SurfaceConfiguration<V>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl<V> Debug for SurfaceConfiguration<V>where
V: Debug,
impl<V> Debug for SurfaceConfiguration<V>where
V: Debug,
§impl<V> Hash for SurfaceConfiguration<V>where
V: Hash,
impl<V> Hash for SurfaceConfiguration<V>where
V: Hash,
§impl<V> PartialEq for SurfaceConfiguration<V>where
V: PartialEq,
impl<V> PartialEq for SurfaceConfiguration<V>where
V: PartialEq,
§fn eq(&self, other: &SurfaceConfiguration<V>) -> bool
fn eq(&self, other: &SurfaceConfiguration<V>) -> bool
self and other values to be equal, and is used
by ==.impl<V> Eq for SurfaceConfiguration<V>where
V: Eq,
impl<V> StructuralEq for SurfaceConfiguration<V>
impl<V> StructuralPartialEq for SurfaceConfiguration<V>
Auto Trait Implementations§
impl<V> RefUnwindSafe for SurfaceConfiguration<V>where
V: RefUnwindSafe,
impl<V> Send for SurfaceConfiguration<V>where
V: Send,
impl<V> Sync for SurfaceConfiguration<V>where
V: Sync,
impl<V> Unpin for SurfaceConfiguration<V>where
V: Unpin,
impl<V> UnwindSafe for SurfaceConfiguration<V>where
V: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CallHasher for T
impl<T> CallHasher for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.