Skip to main content

HardwareRenderer

Struct HardwareRenderer 

Source
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.

Source

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.
Source

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.
Source

pub fn capture_reference_readback( &mut self, display_list: &DisplayList, damage: DamageRegion, ) -> &Framebuffer

Captures an on-demand CPU reference framebuffer readback without enabling steady-state CPU mirroring.

§Arguments
  • &Self - Mutable hardware renderer.
  • &DisplayList - Display list to rasterize through the CPU reference backend.
  • DamageRegion - Damage region to rasterize.
§Returns
  • &Framebuffer - Rendered reference RGBA8 framebuffer.
Source

pub fn complete_gpu_fence(&mut self, fence_id: u64) -> usize

Signals completion of GPU submission fence_id to release staging ring slots and reclaim deferred resources.

§Arguments
  • &Self - Mutable hardware renderer.
  • u64 - Completed monotonic GPU fence identifier.
§Returns
  • usize - Number of deferred GPU resources reclaimed.
Source

pub fn trim_gpu_caches(&mut self, retain_ratio: f32) -> usize

Trims invisible persistent GPU scroll tile caches under memory pressure according to retain_ratio.

§Arguments
  • &Self - Mutable hardware renderer.
  • f32 - Retained budget fraction in (0.0..=1.0].
§Returns
  • usize - Number of cold scroll tiles evicted to fence-deferred reclamation.
Source

pub fn last_frame_telemetry(&self) -> (usize, usize, usize, usize, usize)

Returns latest-frame GPU batching and upload telemetry (batches, coalesced_merges, culled_instances, uploaded_instances, uploaded_bytes).

§Arguments
  • &Self - Hardware renderer reference.
§Returns
  • (usize, usize, usize, usize, usize) - Latest frame batching and upload telemetry tuple.
Source

pub fn active_batches_slice(&self) -> &[GpuBatch]

Returns the slice of active GpuBatch submissions populated for the latest rendered frame.

§Arguments
  • &Self - Hardware renderer reference.
§Returns
  • &[GpuBatch] - Active order-preserving GPU draw batches.
Source

pub fn batch_hash(&self) -> u64

Computes a deterministic 64-bit FNV-1a hash over all compiled GPU batch instances.

§Arguments
  • &Self - Hardware renderer reference.
§Returns
  • u64 - Deterministic batch geometry hash.
Source

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

Source

pub fn get_driver(&self) -> &NativeGpuDriver

Source

pub fn get_mut_driver(&mut self) -> &mut NativeGpuDriver

Source

pub fn set_driver(&mut self, val: NativeGpuDriver) -> &mut Self

Source

pub fn get_active_batches(&self) -> usize

Source

pub fn get_last_submitted_batches(&self) -> usize

Source

pub fn get_last_coalesced_merges(&self) -> usize

Source

pub fn get_last_culled_instances(&self) -> usize

Source

pub fn get_last_uploaded_instances(&self) -> usize

Source

pub fn get_last_uploaded_bytes(&self) -> usize

Source

pub fn get_readback(&self) -> &SoftwareRenderer

Source

pub fn get_mut_readback(&mut self) -> &mut SoftwareRenderer

Source

pub fn set_readback(&mut self, val: SoftwareRenderer) -> &mut Self

Source

pub fn get_enable_readback(&self) -> bool

Source

pub fn get_mut_enable_readback(&mut self) -> &mut bool

Source

pub fn set_enable_readback(&mut self, val: bool) -> &mut Self

Source

pub fn get_resource_ring(&self) -> &GpuResourceRing

Source

pub fn get_mut_resource_ring(&mut self) -> &mut GpuResourceRing

Source

pub fn set_resource_ring(&mut self, val: GpuResourceRing) -> &mut Self

Source

pub fn get_direct_gpu_frames(&self) -> u64

Source

pub fn get_cpu_readback_frames(&self) -> u64

Source

pub fn get_last_cpu_rgba_upload_bytes(&self) -> usize

Source

pub fn get_has_unsupported_effect(&self) -> bool

Source

pub fn get_last_fence_id(&self) -> u64

Source

pub fn get_blur_passes(&self) -> &Vec<GpuBackdropBlurPass>

Source

pub fn get_mut_blur_passes(&mut self) -> &mut Vec<GpuBackdropBlurPass>

Source

pub fn set_blur_passes(&mut self, val: Vec<GpuBackdropBlurPass>) -> &mut Self

Source

pub fn get_active_scroll_offset(&self) -> [f32; 2]

Source

pub fn get_mut_active_scroll_offset(&mut self) -> &mut [f32; 2]

Source

pub fn set_active_scroll_offset(&mut self, val: [f32; 2]) -> &mut Self

Source

pub fn get_active_layer_id(&self) -> u8

Source

pub fn get_mut_active_layer_id(&mut self) -> &mut u8

Source

pub fn set_active_layer_id(&mut self, val: u8) -> &mut Self

Source

pub fn get_last_uploaded_primitive_bytes(&self) -> usize

Trait Implementations§

Source§

impl Debug for HardwareRenderer

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for HardwareRenderer

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Forget for HardwareRenderer

§

impl Freeze for HardwareRenderer

§

impl Move for HardwareRenderer

§

impl RefUnwindSafe for HardwareRenderer

§

impl Send for HardwareRenderer
where RawVecInner: Send, BoxRaw<[[u8; 256]; 4]>: Send,

§

impl Sync for HardwareRenderer
where RawVecInner: Sync, BoxRaw<[[u8; 256]; 4]>: Sync,

§

impl Unpin for HardwareRenderer
where *const u8 is !null: Unpin, Box<[[u8; 256]; 4]>: Unpin,

§

impl UnsafeUnpin for HardwareRenderer

§

impl UnwindSafe for HardwareRenderer
where RawVecInner: UnwindSafe, BoxRaw<[[u8; 256]; 4]>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.