pub struct HardwareRenderer { /* private fields */ }Expand description
Hardware GPU renderer compiling DisplayList streams into order-preserving coalesced instanced GpuBatch calls.
Implementations§
Source§impl HardwareRenderer
Instanced batch builder, order-preserving coalescer, and telemetry methods for HardwareRenderer.
impl HardwareRenderer
Instanced batch builder, order-preserving coalescer, and telemetry methods for HardwareRenderer.
Sourcepub fn with_backend(
backend: GraphicsBackend,
width: u32,
height: u32,
config: RenderConfig,
enable_readback: bool,
) -> Self
pub fn with_backend( backend: GraphicsBackend, width: u32, height: u32, config: RenderConfig, enable_readback: bool, ) -> Self
Creates a hardware renderer bound to backend with optional deterministic pixel readback.
§Arguments
GraphicsBackend- Selected GPU backend.u32- Initial physical width.u32- Initial physical height.RenderConfig- Rendering configuration.bool- Whether software readback mirror is enabled.
§Returns
Self- Configured hardware renderer.
Sourcepub fn with_backend_and_font(
backend: GraphicsBackend,
width: u32,
height: u32,
config: RenderConfig,
enable_readback: bool,
font_provider: NativeSystemFont,
) -> Self
pub fn with_backend_and_font( backend: GraphicsBackend, width: u32, height: u32, config: RenderConfig, enable_readback: bool, font_provider: NativeSystemFont, ) -> Self
Creates a hardware renderer bound to backend with an explicit font provider for readback.
§Arguments
GraphicsBackend- Selected GPU backend.u32- Initial physical width.u32- Initial physical height.RenderConfig- Rendering configuration.bool- Whether software readback mirror is enabled.NativeSystemFont- Font provider used by the software readback mirror.
§Returns
Self- Configured hardware renderer.
Sourcepub fn batch_hash(&self) -> u64
pub fn batch_hash(&self) -> u64
Sourcepub fn render(
&mut self,
display_list: &DisplayList,
damage: DamageRegion,
) -> Result<(usize, usize), PlatformError>
pub fn render( &mut self, display_list: &DisplayList, damage: DamageRegion, ) -> Result<(usize, usize), PlatformError>
Compiles display_list into order-preserving coalesced GPU instanced batches and submits them to the GPU driver.
§Arguments
&Self- Mutable hardware renderer.&DisplayList- Backend-agnostic draw command stream.DamageRegion- Active damage region for readback mirroring.
§Returns
Result<(usize, usize), PlatformError>- Tuple of(draw_batches, pixels_shaded).
Source§impl HardwareRenderer
impl HardwareRenderer
pub fn get_driver(&self) -> &NativeGpuDriver
pub fn get_mut_driver(&mut self) -> &mut NativeGpuDriver
pub fn set_driver(&mut self, val: NativeGpuDriver) -> &mut Self
pub fn get_active_batches(&self) -> usize
pub fn get_last_submitted_batches(&self) -> usize
pub fn get_last_coalesced_merges(&self) -> usize
pub fn get_last_culled_instances(&self) -> usize
pub fn get_last_uploaded_instances(&self) -> usize
pub fn get_last_uploaded_bytes(&self) -> usize
pub fn get_readback(&self) -> &SoftwareRenderer
pub fn get_mut_readback(&mut self) -> &mut SoftwareRenderer
pub fn set_readback(&mut self, val: SoftwareRenderer) -> &mut Self
pub fn get_enable_readback(&self) -> bool
pub fn get_mut_enable_readback(&mut self) -> &mut bool
pub fn set_enable_readback(&mut self, val: bool) -> &mut Self
Trait Implementations§
Source§impl Debug for HardwareRenderer
impl Debug for HardwareRenderer
Auto Trait Implementations§
impl Forget for HardwareRenderer
impl Freeze for HardwareRenderer
impl Move for HardwareRenderer
impl RefUnwindSafe for HardwareRenderer
impl Send for HardwareRenderer
impl Sync for HardwareRenderer
impl Unpin for HardwareRenderer
impl UnsafeUnpin for HardwareRenderer
impl UnwindSafe for HardwareRenderer
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