lib-ui · crate
kinogaki-ui-wgpu
kinogaki-ui drawn with wgpu.
- Repository
- lib-ui (kinogaki/lib-ui)
- Folder
libs/lib-ui/crates/wgpu- Source
- 10 files, 3,133 lines
- Tests
- 2 files, 63 lines
Also 3 shader or C files, 240 lines.
What it is
kinogaki-ui drawn with wgpu.
If you're targeting WebGL you also need to turn on the webgl feature of the wgpu crate:
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
Depends on
| Crate | Repository | As | What it is |
|---|---|---|---|
kinogaki-png | lib-image | normal | PNG images (ISO/IEC 15948, W3C PNG Third Edition) over kinogaki_deflate. |
kinogaki-ui | lib-ui | normal | Kinogaki UI: the immediate-mode UI framework Kinogaki applications are built on. |
Third-party
| Crate | Version | Licence | Frozen in | As | Also used by |
|---|---|---|---|---|---|
bytemuck | 1.25.2 | Zlib OR Apache-2.0 OR MIT | lib-ui/vendor | normal | kinogaki-composit-wgpu, kinogaki-geometry, kinogaki-geometry-view, kinogaki-image-pipeline, kinogaki-math, kinogaki-pixel, kinogaki-ui, kinogaki-viewport-api and 2 more |
log | 0.4.34 | MIT OR Apache-2.0 | lib-ui/vendor | normal | kinogaki-editor, kinogaki-image-pipeline, kinogaki-scene, kinogaki-shared, kinogaki-ui, kinogaki-ui-shell |
raw-window-handle | 0.6.2 | MIT OR Apache-2.0 OR Zlib | lib-ui/vendor | normal | kinogaki-ui-shell |
thiserror | 2.0.21 | MIT OR Apache-2.0 | lib-ui/vendor | normal | kinogaki-document, kinogaki-lsystem, kinogaki-network, kinogaki-shared |
wgpu | 30.0.1 | MIT OR Apache-2.0 | lib-ui/vendor | normal | kinogaki-color-wgpu, kinogaki-composit-wgpu, kinogaki-editor, kinogaki-render-api, kinogaki-shared, kinogaki-ui-shell, kinogaki-viewport-gpu |
Used by
| Crate | Repository | As | What it is |
|---|---|---|---|
kinogaki-editor | Core and the app | normal | Kinogaki Studio's editor: the document and everything the window shows of it, as parts one frame borrows one by one. |
kinogaki-harness | Core and the app | normal | Studio's test harness: the real editor, its event routing and its background work, driven offscreen with only the packages a test names. |
kinogaki-studio | Core and the app | normal | Kinogaki Studio: the editor in a window, after the plugins load. |
kinogaki-ui-shell | lib-ui | normal | Kinogaki UI's native shell: opens the windows, runs the winit event loop, turns window events into kinogaki_ui input, paints each frame with kinogaki-ui-wgpu and drives an App. |
Modules
pixelPixel art's last step (seekinogaki_ui::pixel): the interface is drawn into a low-resolution texture, one texel per art pixel, andUpscale::composedraws it onto the target with every texel a solidfactor×factorblock.305 linesrendererLow-level painting of the UI onwgpu.679 linesrenderer::buffers(private)Uniform, vertex and index uploads for a frame, and the paint callbacks' prepare passes.154 linesrenderer::textures(private)Texture uploads and native textures: the renderer's texture bind groups and samplers.328 linessetup(private)no module doc410 linesblock_on(private)Runs a future to completion on the calling thread (wgpu's adapter and device requests): poll, park until woken, poll again.29 linescaptureScreenshots of a whole application UI, for headless tests and captures.328 linescapture::headless(private)Driving an application's UI without a window.205 linescapture::script(private)Capture scripts: input steps that bring a UI into the state a capture shows (a menu open, a hovered item, typed text).164 lines
Public types and traits
At the crate root
Traits CallbackTraitCloneableDisplayHandle
Structs CallbackRendererRendererOptionsRenderStateScreenDescriptorSurfaceConfigTextureWgpuConfigurationWgpuSetupCreateNewWgpuSetupExisting
Enums AdapterLimitsSurfaceErrorActionWgpuErrorWgpuSetup
Type aliases NativeAdapterSelectorMethod
Re-exported from other crates
From wgpu (the crate)
By module: 22 public types and traits in 6 modules
capture CaptureErrorFrameScreen
capture::headless AppHeadless
capture::script PointScriptStep
pixel FrameUpscale
renderer CallbackCallbackTraitRendererRendererOptionsScreenDescriptorTexture
setup AdapterLimitsCloneableDisplayHandleNativeAdapterSelectorMethodWgpuSetupWgpuSetupCreateNewWgpuSetupExisting
Besides these, 8 public functions at module level.
