Expand description
This crates provides bindings between egui and wgpu.
If you’re targeting WebGL you also need to turn on the
webgl feature of the wgpu crate:
# Enable both WebGL and WebGPU backends on web.
wgpu = { version = "*", features = ["webgpu", "webgl"] }You can control whether WebGL or WebGPU will be picked at runtime by configuring
WgpuConfiguration::wgpu_setup.
The default is to prefer WebGPU and fall back on WebGL.
§Feature flags
- winit— Enable- winitintegration. On Linux, requires either- waylandor- x11
- wayland— Enables Wayland support for winit.
- x11— Enables x11 support for winit.
- fragile-send-sync-non-atomic-wasm(enabled by default) — Make the renderer- Syncon wasm, exploiting that by default wasm isn’t multithreaded. It may make code easier, especially when targeting both native and web. On native most wgpu objects are send and sync, on the web they are not (by nature of the WebGPU specification). This is not supported in multithreaded WASM. Thus that usage is guarded against with compiler errors in wgpu.
Re-exports§
- pub use wgpu;
Modules§
- capture
- Helpers for capturing screenshots of the UI.
- winit
- Module for painting eguiwithwgpuonwinit.
Structs§
- Callback
- You can use this to do custom wgpurendering in an egui app.
- RenderState 
- Access to the render state for egui.
- Renderer
- Renderer for a egui based GUI.
- RendererOptions 
- Ways to configure Rendererduring creation.
- ScreenDescriptor 
- Information about the screen used for rendering.
- Texture
- WgpuConfiguration 
- Configuration for using wgpu with eframe or the egui-wgpu winit feature.
- WgpuSetup Create New 
- Configuration for creating a new wgpu setup.
- WgpuSetup Existing 
- Configuration for using an existing wgpu setup.
Enums§
- SurfaceError Action 
- Specifies which action should be taken as consequence of a wgpu::SurfaceError
- WgpuError 
- An error produced by egui-wgpu.
- WgpuSetup 
Traits§
- CallbackTrait 
- A callback trait that can be used to compose an epaint::PaintCallbackviaCallbackfor custom WGPU rendering.
Functions§
- adapter_info_ summary 
- A human-readable summary about an adapter
- depth_format_ from_ bits 
- Take’s epi’s depth/stencil bits and returns the corresponding wgpu format.
- parse_vendor_ id 
- Tries to parse the adapter’s vendor ID to a human-readable string.
- preferred_framebuffer_ format 
- Find the framebuffer format that egui prefers
Type Aliases§
- CallbackResources 
- You can use this for storage when implementing CallbackTrait.
- NativeAdapter Selector Method 
- Method for selecting an adapter on native.