pub struct WgpuRendererOptions { /* private fields */ }Expand description
Options used when creating a WgpuRenderer.
Implementations§
Source§impl WgpuRendererOptions
impl WgpuRendererOptions
Sourcepub fn new(
present_mode: RendererPresentMode,
scale_factor: f64,
) -> Result<Self, RendererConfigurationError>
pub fn new( present_mode: RendererPresentMode, scale_factor: f64, ) -> Result<Self, RendererConfigurationError>
Builds options from presentation behavior and display scale.
scale_factor is physical surface pixels per logical screen pixel. It
must be finite, representable as f32, and bounded so every non-empty
u32 surface keeps its logical dimensions and reciprocal clip scale in
the normal finite f32 range.
Sourcepub fn with_max_quarantined_devices(
self,
limit: usize,
) -> Result<Self, RendererConfigurationError>
pub fn with_max_quarantined_devices( self, limit: usize, ) -> Result<Self, RendererConfigurationError>
Sets the bounded number of previous logical devices retained after recovery.
The default is 4 and the supported range is 1..=8. Retention avoids a
native Linux driver crash observed when a healthy device is destroyed
immediately after surface migration. Once the limit is reached, another
recovery returns RendererInitError::RecoveryLimitReached before
requesting or installing a replacement device.
Sourcepub fn present_mode(self) -> RendererPresentMode
pub fn present_mode(self) -> RendererPresentMode
Returns presentation behavior for the surface.
Sourcepub fn scale_factor(self) -> f64
pub fn scale_factor(self) -> f64
Returns physical surface pixels per logical screen pixel.
Sourcepub fn max_quarantined_devices(self) -> usize
pub fn max_quarantined_devices(self) -> usize
Returns the maximum previous logical devices retained after recovery.
Trait Implementations§
Source§impl Clone for WgpuRendererOptions
impl Clone for WgpuRendererOptions
Source§fn clone(&self) -> WgpuRendererOptions
fn clone(&self) -> WgpuRendererOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more