pub struct PlanRenderer { /* private fields */ }Expand description
Draws ChunkDraws; see the crate documentation.
Uploads happen in Self::prepare; Self::paint only records draw calls, so it can
run inside a render pass that a UI toolkit owns.
Implementations§
Source§impl PlanRenderer
impl PlanRenderer
Sourcepub fn new(device: &Device, format: TextureFormat) -> Self
pub fn new(device: &Device, format: TextureFormat) -> Self
Creates the pipeline for color targets of format, single-sampled, blending
premultiplied alpha.
Sourcepub fn chunk_buffers(&self) -> usize
pub fn chunk_buffers(&self) -> usize
Number of chunk buffers currently held.
Sourcepub fn prepare(
&mut self,
device: &Device,
queue: &Queue,
id: u64,
draws: &[ChunkDraw],
target: PlanTarget,
)
pub fn prepare( &mut self, device: &Device, queue: &Queue, id: u64, draws: &[ChunkDraw], target: PlanTarget, )
Uploads changed chunks and the per-chunk positions of draws and stores them under
id, which Self::paint takes. Use a new, increasing id per painted canvas and
frame; the last 16 are kept. Chunk buffers not drawn for 600 prepared frames are
released.
Sourcepub fn paint(&self, pass: &mut RenderPass<'_>, id: u64)
pub fn paint(&self, pass: &mut RenderPass<'_>, id: u64)
Records the draws prepared under id; nothing when there are none.
Auto Trait Implementations§
impl !RefUnwindSafe for PlanRenderer
impl !UnwindSafe for PlanRenderer
impl Freeze for PlanRenderer
impl Send for PlanRenderer
impl Sync for PlanRenderer
impl Unpin for PlanRenderer
impl UnsafeUnpin for PlanRenderer
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