Expand description
One egui pass drawn into an offscreen texture: the desktop loop’s captures while the window is not being drawn. Render one egui pass into an offscreen texture and read it back.
The desktop loop’s on-demand pass (desktop_loop) never presents to the
window: a hidden Wayland surface gets no frame callbacks, and presenting to
it can block. A capture asked for during such a pass is drawn here instead,
with the window’s own egui_wgpu::RenderState: the same device, the same
renderer (so its textures and the 3D viewport’s paint-callback resources
are the ones the window draws with) and the same target format.
Functions§
- apply_
texture_ frees - Free the textures the pass released, after anything that drew with them.
- apply_
texture_ sets - Upload the pass’s new and changed textures to the shared renderer. The window’s next real frame never sees this pass’s texture delta, so the pass must apply it itself (a font atlas page added here is drawn there).
- capture
- Draw
shapesatsize_px(pixels_per_point) overclearand return the picture. Its texture delta must already be applied (apply_texture_sets).