Expand description
wgpu GPU render surface — CPU-side preparation engine for OxiUI.
This crate provides the full CPU-side rendering preparation stack that a
future GPU RenderBackend implementation will compose:
atlas— Dynamic shelf-based texture atlas with LRU eviction.batch— Draw-call batcher: sortsDrawListcommands by pipeline state, merges adjacent same-key runs, and culls off-screen commands.clip— Nested clip-rect stack with outward-rounded integer scissor.quality—RenderQualitypresets (low / balanced / high).resource— Generation-checkedTextureHandle/ShaderHandlenewtypes with a reference-countedResourceRegistryand RAII guards.error—GpuErrorKind→UiErrormapping.gpu— the real headless GPU backend (WgpuBackend) built onwgpu: offscreen device init, thesolid.wgslpipeline, and aRenderBackendimplementation for solid rectangles, SDF circles, and scissor-based clipping, with CPU pixel readback.
GPU drivers (Vulkan/Metal/DX12/WebGPU) are OS-provided at runtime;
they are NOT linked at build time. gpu::WgpuBackend::headless acquires
an adapter at runtime and gracefully reports UiError::Unsupported when
none is available.
Re-exports§
pub use atlas::AtlasHandle;pub use atlas::AtlasRect;pub use atlas::TextureAtlas;pub use batch::BatchKey;pub use batch::BlendMode;pub use batch::DrawBatch;pub use batch::PipelineKind;pub use batch::PreparedFrame;pub use clip::ClipRect;pub use clip::ClipStack;pub use error::map_gpu_error;pub use error::GpuErrorKind;pub use gpu::GpuContext;pub use gpu::SolidPipeline;pub use gpu::WgpuBackend;pub use quality::RenderQuality;pub use quality::ShadowQuality;pub use quality::TextQuality;pub use resource::ResourceId;pub use resource::ResourceRegistry;pub use resource::ShaderGuard;pub use resource::ShaderHandle;pub use resource::TextureGuard;pub use resource::TextureHandle;
Modules§
- atlas
- Dynamic texture atlas with shelf-based bin packing and LRU eviction.
- batch
- Draw-call batcher that groups
DrawListcommands by pipeline state. - clip
- Nested clip-rectangle stack with intersection and integer-scissor output.
- error
- GPU error mapping to
oxiui_core::UiError. - gpu
- Real (non-stub) headless GPU rendering for OxiUI, built on
wgpu. - quality
- Configurable render-quality settings.
- resource
- Generation-checked resource handles and reference-counted registry.
Structs§
- Wgpu
Prep - The CPU-side preparation state for the wgpu render pipeline.
- Wgpu
Renderer - Placeholder GPU renderer kept for backward compatibility.