Skip to main content

Crate oxiui_render_wgpu

Crate oxiui_render_wgpu 

Source
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: sorts DrawList commands by pipeline state, merges adjacent same-key runs, and culls off-screen commands.
  • clip — Nested clip-rect stack with outward-rounded integer scissor.
  • qualityRenderQuality presets (low / balanced / high).
  • resource — Generation-checked TextureHandle/ShaderHandle newtypes with a reference-counted ResourceRegistry and RAII guards.
  • errorGpuErrorKindUiError mapping.
  • gpu — the real headless GPU backend (WgpuBackend) built on wgpu: offscreen device init, the solid.wgsl pipeline, and a RenderBackend implementation 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 DrawList commands 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§

WgpuPrep
The CPU-side preparation state for the wgpu render pipeline.
WgpuRenderer
Placeholder GPU renderer kept for backward compatibility.