pub struct WgpuRenderer { /* private fields */ }Implementations§
Source§impl WgpuRenderer
impl WgpuRenderer
pub fn capture_last_frame_rgba( &mut self, window_id: WindowId, ) -> Result<RgbaImage>
Sourcepub fn capture_last_frame_debug(
&mut self,
window_id: WindowId,
request: DebugCaptureRequest,
) -> Result<DebugCaptureArtifact>
pub fn capture_last_frame_debug( &mut self, window_id: WindowId, request: DebugCaptureRequest, ) -> Result<DebugCaptureArtifact>
Capture window_id’s last frame at the requested stage, waiting for
the GPU to copy it back. Browsers cannot wait; begin captures there
with begin_debug_capture.
Sourcepub fn begin_debug_capture(
&mut self,
window_id: WindowId,
request: DebugCaptureRequest,
) -> Result<DebugCaptureId>
pub fn begin_debug_capture( &mut self, window_id: WindowId, request: DebugCaptureRequest, ) -> Result<DebugCaptureId>
Start capturing window_id’s last frame at the requested stage: draw
it again offscreen and begin copying it back. Nothing waits for the
GPU, so this works in browsers too. Collect the artifact with
take_finished_debug_captures
once the copy is back.
Sourcepub fn has_debug_captures_in_flight(&self, window_id: WindowId) -> bool
pub fn has_debug_captures_in_flight(&self, window_id: WindowId) -> bool
Whether captures of window_id are still being copied back.
Sourcepub fn take_finished_debug_captures(
&mut self,
window_id: WindowId,
) -> Vec<(DebugCaptureId, Result<DebugCaptureArtifact>)>
pub fn take_finished_debug_captures( &mut self, window_id: WindowId, ) -> Vec<(DebugCaptureId, Result<DebugCaptureArtifact>)>
The captures of window_id whose pixels are back, each handed out
once. Never waits for the GPU.
Sourcepub fn wait_for_debug_captures(&self) -> Result<()>
pub fn wait_for_debug_captures(&self) -> Result<()>
Wait until the GPU has copied back every capture begun. Browsers cannot wait, so this is native-only.
Sourcepub fn capture_debug_frame(
&self,
window_id: WindowId,
request: DebugCaptureRequest,
) -> Result<DebugCaptureArtifact>
pub fn capture_debug_frame( &self, window_id: WindowId, request: DebugCaptureRequest, ) -> Result<DebugCaptureArtifact>
Capture the frame last drawn at request’s stage, waiting for the
GPU to copy it back.
pub fn capture_rgba(&self, window_id: WindowId) -> Result<RgbaImage>
pub fn capture_hdr_intermediate_rgba_f32( &self, window_id: WindowId, ) -> Result<HdrRgbaImage>
Source§impl WgpuRenderer
impl WgpuRenderer
Sourcepub fn prepare_device(&mut self)
pub fn prepare_device(&mut self)
Start offscreen device preparation while the host constructs/layouts its
first frame. Desktop hosts should use prepare_window for surface-aware
adapter selection. Other targets retain their existing initialization path.
Source§impl WgpuRenderer
impl WgpuRenderer
pub fn new() -> Self
pub fn with_feathering(self, feathering: FeatheringOptions) -> Self
pub fn with_feathering_enabled(self, enabled: bool) -> Self
pub fn with_text_coverage_policy(self, policy: TextCoveragePolicy) -> Self
pub fn with_text_render_mode(self, mode: TextRenderMode) -> Self
pub fn with_text_subpixel_order(self, order: TextSubpixelOrder) -> Self
pub fn with_text_hinting(self, hinting: TextHinting) -> Self
pub fn with_stem_darkening(self, darkening: StemDarkening) -> Self
pub fn with_feather_width(self, feather_width: f32) -> Self
pub fn with_vsync_enabled(self, enabled: bool) -> Self
pub fn with_external_texture_registry( self, registry: WgpuExternalTextureRegistry, ) -> Self
pub fn feathering(&self) -> FeatheringOptions
pub fn feathering_enabled(&self) -> bool
pub fn feather_width(&self) -> f32
pub fn vsync_enabled(&self) -> bool
pub fn external_texture_registry(&self) -> Option<&WgpuExternalTextureRegistry>
pub fn set_external_texture_registry( &mut self, registry: WgpuExternalTextureRegistry, )
pub fn text_coverage_policy(&self) -> TextCoveragePolicy
pub fn text_render_mode(&self) -> TextRenderMode
pub fn text_subpixel_order(&self) -> TextSubpixelOrder
pub fn text_hinting(&self) -> TextHinting
pub fn stem_darkening(&self) -> StemDarkening
pub fn set_feathering(&mut self, feathering: FeatheringOptions)
pub fn set_feathering_enabled(&mut self, enabled: bool)
pub fn set_text_coverage_policy(&mut self, policy: TextCoveragePolicy)
pub fn set_text_render_mode(&mut self, mode: TextRenderMode)
pub fn set_text_subpixel_order(&mut self, order: TextSubpixelOrder)
pub fn set_text_hinting(&mut self, hinting: TextHinting)
pub fn set_stem_darkening(&mut self, darkening: StemDarkening)
pub fn set_feather_width(&mut self, feather_width: f32)
pub fn set_vsync_enabled(&mut self, enabled: bool)
pub fn set_window_display_capabilities( &mut self, window_id: WindowId, capabilities: DisplayCapabilities, ) -> Result<()>
pub fn window_display_capabilities( &self, window_id: WindowId, ) -> Option<DisplayCapabilities>
pub fn set_window_color_management( &mut self, window_id: WindowId, color_management: ColorManagementMode, ) -> Result<()>
Sourcepub fn window_color_management(
&self,
window_id: WindowId,
) -> ColorManagementMode
pub fn window_color_management( &self, window_id: WindowId, ) -> ColorManagementMode
The color management window_id renders with.
Sourcepub fn window_output_strategy(
&self,
window_id: WindowId,
) -> Option<OutputStrategy>
pub fn window_output_strategy( &self, window_id: WindowId, ) -> Option<OutputStrategy>
The strategy window_id presents with. A window without a surface
reports the strategy it would use on the display it was given.
pub fn window_surface_formats( &self, window_id: WindowId, ) -> Option<Vec<TextureFormat>>
pub fn set_runtime_feathering_override( &mut self, feathering: Option<FeatheringOptions>, )
pub fn set_runtime_text_subpixel_order_override( &mut self, order: Option<TextSubpixelOrder>, )
Sourcepub fn set_runtime_system_text_smoothing_enabled(&mut self, enabled: bool)
pub fn set_runtime_system_text_smoothing_enabled(&mut self, enabled: bool)
Whether the window being rendered follows the system’s text smoothing:
LCD text in the order its display capabilities report
(DisplayCapabilities::text_subpixel_order). On by default.
pub fn set_runtime_text_hinting_override( &mut self, hinting: Option<TextHinting>, )
pub fn set_runtime_stem_darkening_override( &mut self, darkening: Option<StemDarkening>, )
pub fn set_runtime_text_coverage_policy_override( &mut self, policy: Option<TextCoveragePolicy>, )
pub fn set_runtime_diagnostics_enabled(&mut self, enabled: bool)
pub fn remove_window(&mut self, window_id: WindowId)
pub fn render(&mut self, frame: &SceneFrame) -> Result<()>
pub fn capabilities(&self) -> RendererCapabilities
Sourcepub fn adapter_info(&self) -> Option<AdapterInfo>
pub fn adapter_info(&self) -> Option<AdapterInfo>
Adapter metadata after initialization, without requiring an interop registry.
pub fn frames_rendered(&self) -> usize
pub fn last_frame(&self, window_id: WindowId) -> Option<&SceneFrame>
pub fn last_frame_stats( &self, window_id: WindowId, ) -> Option<RendererFrameStats>
pub fn text_cache_snapshot( &self, window_id: WindowId, ) -> RendererTextCacheSnapshot
Source§impl WgpuRenderer
impl WgpuRenderer
Sourcepub fn prepare_window(
&mut self,
window_id: WindowId,
window: Arc<Window>,
) -> Result<()>
pub fn prepare_window( &mut self, window_id: WindowId, window: Arc<Window>, ) -> Result<()>
Begin device setup using this native surface before the first CPU layout.
Call register_window afterwards to finish configuration. Preparation is
optional, idempotent, and cancelled when the window/renderer is removed.
pub fn register_window( &mut self, window_id: WindowId, window: Arc<Window>, ) -> Result<()>
Trait Implementations§
Source§impl Debug for WgpuRenderer
impl Debug for WgpuRenderer
Auto Trait Implementations§
impl !Freeze for WgpuRenderer
impl !RefUnwindSafe for WgpuRenderer
impl !Sync for WgpuRenderer
impl !UnwindSafe for WgpuRenderer
impl Send for WgpuRenderer
impl Unpin for WgpuRenderer
impl UnsafeUnpin for WgpuRenderer
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.