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 set_font_provider(
&mut self,
font_provider: NativeSystemFont,
) -> &mut Self
pub fn set_font_provider( &mut self, font_provider: NativeSystemFont, ) -> &mut Self
Sourcepub fn capture_reference_readback(
&mut self,
display_list: &DisplayList,
damage: DamageRegion,
) -> &Framebuffer
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.
Sourcepub fn complete_gpu_fence(&mut self, fence_id: u64) -> usize
pub fn complete_gpu_fence(&mut self, fence_id: u64) -> usize
Sourcepub fn trim_gpu_caches(&mut self, retain_ratio: f32) -> usize
pub fn trim_gpu_caches(&mut self, retain_ratio: f32) -> usize
Sourcepub fn active_batches_slice(&self) -> &[GpuBatch]
pub fn active_batches_slice(&self) -> &[GpuBatch]
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).
Sourcepub fn render_with_physical_size(
&mut self,
display_list: &DisplayList,
damage: DamageRegion,
physical_size: Option<(u32, u32)>,
) -> Result<(usize, usize), PlatformError>
pub fn render_with_physical_size( &mut self, display_list: &DisplayList, damage: DamageRegion, physical_size: Option<(u32, u32)>, ) -> Result<(usize, usize), PlatformError>
Compiles display_list into 64-byte GpuPrimitiveInstance batches using authoritative physical backing dimensions when provided.
§Arguments
&Self- Mutable hardware renderer.&DisplayList- Backend-agnostic draw command stream.DamageRegion- Active damage region for readback mirroring.Option<(u32, u32)>- Authoritative(physical_width, physical_height)preventing(logical * scale).round()drift.
§Returns
Result<(usize, usize), PlatformError>- Tuple of(draw_batches, pixels_shaded).
Source§impl HardwareRenderer
Implements impl #impl_generics #name #ty_generics #where_clause.
impl HardwareRenderer
Implements impl #impl_generics #name #ty_generics #where_clause.