v0.25.1
wgpu desktop backend (experimental) — new feature = "wgpu" runs mirui on Vulkan / Metal / DX12 / OpenGL ES through a winit window, with one render pass per frame, a uniform ring buffer for batched draws, and shared bind groups whose binding 1 carries a dynamic offset.
Added
feature = "wgpu"— opt-in cross-platform GPU backend onwgpu29 andwinit0.30.mirui::surface::wgpu_surface::WgpuSurface+mirui::draw::wgpu_render::WgpuRendererFactory.- 4× MSAA, perspective-correct quad blit (
Transform3D::from_quadrecovers the homography), rounded-rect SDF for both axis-aligned and 2.5D quad widgets, glyph atlas, lyon-tessellated paths. Mailbox > Immediate > Fifopresent-mode preference;Fifois the universal fallback.- Per-draw
set_scissor_rectderived from each command's logical clip, clamped to the swapchain extent.
gallery::runpicks the backend at compile time:--features wgpu>--features sdl-gpu>--features sdl(default).gallery/examples/wgpu_smoke.rs— minimal hello window for the wgpu path.
Changed
mirui::cache::Cachebacks the wgpu render-pipeline cache.Count(N)is the right knob for "admit everything, never evict";MaxSize::Disabledmeans "no insertion at all" and is no longer used for that purpose.gallery::runrequires aSend + 'staticbuilder closure so wgpu shares one demo entrypoint with sdl / sdl-gpu.
Fixed
Canvas::clear(area, color)honoursarea. The wgpu impl was overwriting the whole display, defeating dirty-region renderers that calledclearwith a sub-rect.
Limitations on the wgpu backend
- macOS trackpad two-finger scroll feels less responsive than on the sdl backend.
- Pinch and rotation gestures are not delivered as input events.
ColorFormat::RGB565/RGB565Swappedtextures are skipped byCanvas::blit; convert toRGB888/RGBA8888first.