pub struct OwnLoopRenderer { /* private fields */ }Expand description
Drives one own-loop frame for an egui-winit + egui-wgpu host: it renders the egui UI into
the intermediate (the blur source) and the target (the display), then blurs and composites the
frosted surfaces over the target — all on one encoder with a single submit.
Implementations§
Source§impl OwnLoopRenderer
impl OwnLoopRenderer
Sourcepub fn new(
device: &Device,
target_format: TextureFormat,
) -> Result<Self, BlurError>
pub fn new( device: &Device, target_format: TextureFormat, ) -> Result<Self, BlurError>
Build the adapter for a host whose target (swapchain) has target_format.
Returns BlurError::UnsupportedTarget unless target_format is a non-sRGB Unorm
format (is_supported_target) — the adapter pins the decode-in-shader gamma model, which
only matches non-sRGB targets (egui#3168). This makes the documented format assumption a
checked contract rather than prose.
Sourcepub fn render_frame(
&mut self,
device: &Device,
queue: &Queue,
ctx: &Context,
blur: &mut WgpuBlur,
frame: FrameInput<'_>,
surfaces: &[Surface],
) -> Result<(), BlurError>
pub fn render_frame( &mut self, device: &Device, queue: &Queue, ctx: &Context, blur: &mut WgpuBlur, frame: FrameInput<'_>, surfaces: &[Surface], ) -> Result<(), BlurError>
Render one frosted frame. ctx is the host’s egui context: the adapter applies the
surfaces’ RepaintPolicy to it (request_repaint for Live, request_repaint_after
for Bounded) so a stale backdrop cannot be silently forgotten (§4.6 — the adapter, not
the host, drives the repaint). frame carries the tessellated egui output + the target.