#[non_exhaustive]pub struct GpuConfig {
pub label: &'static str,
pub copy_src: CopySrc,
pub present_mode: PresentMode,
}Expand description
Everything Gpu::new needs beyond the window handle.
Build one with GpuConfig::new (or Default) and the with_*
setters rather than a struct literal — the struct is #[non_exhaustive]
so new knobs can be added without a breaking release:
use agg_gui_wgpu::{CopySrc, GpuConfig};
let cfg = GpuConfig::new("my-app").with_copy_src(CopySrc::IfSupported);Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.label: &'static strwgpu::DeviceDescriptor label — shows up in backend validation
messages and GPU captures, so each shell names its own.
copy_src: CopySrcSurface read-back requirement, see CopySrc.
present_mode: PresentModePresent mode for the swap chain. AutoVsync for normal windows.
Implementations§
Source§impl GpuConfig
impl GpuConfig
Sourcepub fn new(label: &'static str) -> Self
pub fn new(label: &'static str) -> Self
Default configuration under a shell-specific device label.
pub fn with_copy_src(self, copy_src: CopySrc) -> Self
Sourcepub fn with_present_mode(self, present_mode: PresentMode) -> Self
pub fn with_present_mode(self, present_mode: PresentMode) -> Self
Override the swap-chain present mode (default AutoVsync).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GpuConfig
impl RefUnwindSafe for GpuConfig
impl Send for GpuConfig
impl Sync for GpuConfig
impl Unpin for GpuConfig
impl UnsafeUnpin for GpuConfig
impl UnwindSafe for GpuConfig
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().