mirror of
https://github.com/emilk/egui.git
synced 2026-08-29 12:50:04 -04:00
The map_async callback fires on the render thread inside Queue::submit, so its CPU work (pixel swizzle + buffer copy) blocks the next frame's GPU dispatch. Move the swizzle/send to a dedicated worker thread so submit returns immediately. On wasm (no real threads, !Send Buffer) keep the work inline. While there, replace the per-byte runtime-indexed swizzle loop with chunks_exact and constant indices so LLVM can autovectorize, and add a fast path for Rgba8Unorm that just bytemuck::cast_slice's each row straight into the Vec<Color32>.
egui-wgpu
This crates provides bindings between egui and wgpu.
This was originally hosted at https://github.com/hasenbanck/egui_wgpu_backend