pub struct GpuBatchCollector {
pub viewport_width: f32,
pub viewport_height: f32,
pub quad_batch: GpuBatch,
pub text_pipeline: GpuSlugTextPipeline,
pub path_batch: GpuPathBatch,
pub summary: GpuBatchSummary,
}Expand description
Instanced UI Draw Call Batch Collector for complex layouts (Goal 07).
Batches heterogeneous display lists with 10,000+ commands into <= 5 GPU draw calls.
Fields§
§viewport_width: f32§viewport_height: f32§quad_batch: GpuBatch§text_pipeline: GpuSlugTextPipeline§path_batch: GpuPathBatch§summary: GpuBatchSummaryImplementations§
Source§impl GpuBatchCollector
impl GpuBatchCollector
pub fn new(viewport_width: f32, viewport_height: f32) -> Self
Sourcepub fn collect(
&mut self,
list: &DisplayList,
damage: Option<Rect>,
) -> GpuBatchSummary
pub fn collect( &mut self, list: &DisplayList, damage: Option<Rect>, ) -> GpuBatchSummary
Collects and batches all compatible primitives from a DisplayList.
Sourcepub fn dispatch(
&self,
device: &mut GpuDevice,
damage: Option<Rect>,
) -> Result<GpuBatchSummary, PresentError>
pub fn dispatch( &self, device: &mut GpuDevice, damage: Option<Rect>, ) -> Result<GpuBatchSummary, PresentError>
Dispatches all collected batches onto the GPU device in unified passes.
Sourcepub fn resize(&mut self, viewport_width: f32, viewport_height: f32)
pub fn resize(&mut self, viewport_width: f32, viewport_height: f32)
Updates viewport dimensions for subsequent batch compilations.
Sourcepub fn collect_hardware_frame(
&mut self,
list: &DisplayList,
damage: Option<Rect>,
) -> Hardware2DFrame
pub fn collect_hardware_frame( &mut self, list: &DisplayList, damage: Option<Rect>, ) -> Hardware2DFrame
Compiles a DisplayList into coalesced painter’s-order hardware GPU batches
(GpuBatch, GpuPathBatch, GpuSlugTextPipeline, GpuClipMasks, and DrawViewport3D split points),
eliminating duplicate FillRect/StrokeRect emission and triangulating/stencil-filling closed vector shapes.
Trait Implementations§
Source§impl Clone for GpuBatchCollector
impl Clone for GpuBatchCollector
Auto Trait Implementations§
impl !Freeze for GpuBatchCollector
impl Forget for GpuBatchCollector
impl Move for GpuBatchCollector
impl RefUnwindSafe for GpuBatchCollector
impl Send for GpuBatchCollector
impl Sync for GpuBatchCollector
impl Unpin for GpuBatchCollector
impl UnsafeUnpin for GpuBatchCollector
impl UnwindSafe for GpuBatchCollector
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