lib-viewport · crate
kinogaki-viewport-gpu
Kinogaki's wgpu viewport renderer: pipelines, retained GPU buffers, offscreen multisampled targets and owned WGSL shaders.
- Repository
- lib-viewport (kinogaki/lib-viewport)
- Folder
libs/lib-viewport/crates/gpu- Source
- 27 files, 7,366 lines
- Tests
- 20 files, 2,219 lines
Also 6 shader or C files, 1,303 lines.
What it is
Kinogaki's wgpu viewport renderer: pipelines, retained GPU buffers, offscreen multisampled targets and owned WGSL shaders.
It draws kinogaki-viewport-core scenes — a SurfaceSource packet, an element selection, preview patches and overlay layers — into one texture per view. Camera or selection changes rewrite uniforms and small masks; derived packets upload only their changed ranges. It knows nothing about the geometry domain that produced a packet.
Depends on
| Crate | Repository | As | What it is |
|---|---|---|---|
kinogaki-geometry | SDK | normal | Kinogaki Studio's standard geometry values. |
kinogaki-math | lib-math | normal | Kinogaki's vectors, points, matrices, quaternions and deterministic elementary functions. |
kinogaki-viewport-core | lib-viewport | normal | Kinogaki viewport core: what a 3D viewport shows, independent of any GPU API or UI toolkit. |
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-ui-wgpu and 2 more |
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-ui-wgpu |
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-geometry-view | Core and the app | tests | Geometry, curves and B-reps in the viewport, independent of any GPU API: the SDK's standard values as surface packets (over the SDK's display triangulation and shading normals, so Solid draws what Render renders), the one picker that answers rays and boxes ... |
Modules
gpu(private)no module doc684 linesgpu::batches(private)Scene objects drawn in a few draws, however many there are.766 linesgpu::batches::streams(private)A batch's buffers: its members' streams concatenated with their ids offset, and the bind group over them.150 linesgpu::buffers(private)Upload packet columns directly into contiguous GPU staging memory.427 linesgpu::classes(private)The line classes' records the shaders read, written only when they change.99 linesgpu::derived(private)Vertex shading derived on the GPU from uploaded positions (seeShadingPlan): two compute passes write face and shaded normals into the vertex buffer, so a packet whose points all moved uploads 12 bytes a point instead of 44 a vertex.337 linesgpu::display(private)The display transform colored surfaces are shown through, per pixel.110 linesgpu::face_ids(private)The edited surface as a box selection sees it: each pixel's nearest face and its depth, drawn for one view's camera into single-sampled targets (faces are integers, which don't multisample) and read back over the box once it is let go.364 linesgpu::findings(private)no module doc366 linesgpu::layers(private)The overlay layers' uploads: findings and guides over the packet, world line layers and face normals.88 linesgpu::normals(private)Normal lines (Houdini's normal display): each vertex's shading normal from its point, drawn straight from the uploaded vertex records, and face normals from the application's per-face centers and normals, uploaded once per face set.90 linesgpu::object_outline(private)Selected objects use a coverage silhouette, never polygon tints or interior edges.221 linesgpu::objects(private)The rest of a scene around the edited surface: many packets, each placed by its own transform, drawn shaded, as wires or as see-through ghosts, with object selection and hover silhouettes.717 linesgpu::objects::records(private)The records objects draw with: placements' blocks, kept while the placements, model and flags stay, and the uniform of an object drawn one by one.95 linesgpu::objects::upload(private)An object's own GPU buffers: uploaded once, patched in place when a held packet updates, and the bind group over them.200 linesgpu::packet(private)The edited packet on the GPU: its streams uploaded, patched in place or dropped, and a transform preview's patches written over them and restored, with the motion mask or weights the shaders move points by.346 linesgpu::pipeline(private)no module doc140 linesgpu::render(private)One frame: the scene checked, what changed uploaded, the uniforms written, and the surface, objects and overlays drawn into the view's target.735 linesgpu::see_through(private)See-through faces of the edited surface (SurfaceSource::face_runs): the shaded triangles draw as before, in the ranges between the runs, and each run draws after every opaque surface with its look (binding 6, one record a run, named by the draw's instance) ...142 linesgpu::selected(private)The edited surface's selection on the GPU: one bitset a slot of theElementSelection(faces, lines, markers) at the front of the selection buffer, and what each slot's words are for the shaders (u.picksin mesh.wgsl).109 linesgpu::selection_lines(private)Source edit-overlay selection outlines, separate from the dense background wireframe.145 linesgpu::setup(private)Building the renderer: its buffers, bind groups and pipelines, and the main bind group made again when one of its buffers is replaced.450 linesgpu::target(private)no module doc83 linesgpu::textures(private)The images surfaces show (SurfaceImage), one table for every surface of every view: an array texture of each ofSurfaceImage::SIDES, an image a layer.371 linesshading(private)Surface analysis options.84 lines
Public types and traits
At the crate root
Structs AnalysisSettingsDisplayOptionsDisplayTransformGridPlaneSceneSceneObjectTintsViewportRenderer
Enums ObjectStyleShading
Type aliases Placements
Re-exported from other crates
From wgpu (the crate)
By module: 11 public types and traits in 4 modules
gpu DisplayOptionsGridPlaneSceneViewportRenderer
gpu::display DisplayTransform
gpu::objects ObjectStylePlacementsSceneObjectTints
shading AnalysisSettingsShading
