Skip to main content

Crate cadkit_gpu

Crate cadkit_gpu 

Source
Expand description

wgpu renderers for cadkit_scene.

The renderers take a wgpu::Device, wgpu::Queue, a target format and a wgpu::RenderPass; they do not open windows or depend on a UI toolkit. The wgpu version is part of this crate’s API and is re-exported as wgpu.

GPU validation and out-of-memory errors are captured with error scopes and returned as GpuErrors.

Re-exports§

pub use wgpu;

Structs§

AdapterSummary
Description of the adapter an offscreen image came from.
MeshRenderer
Pipeline for MeshScenes: Depth32Float depth, single-sampled, opaque.
OffscreenImage
RGBA pixels read back from the GPU.
OrbitCamera
A perspective camera orbiting target, with +Z up.
PlanRenderer
Draws ChunkDraws; see the crate documentation.
PlanTarget
Where a frame is drawn, in physical pixels of the render target.
PreparedMeshes
GPU buffers of a prepared scene.
RenderTargetCache
Keeps the depth texture until the size changes and reuses recycled color textures.
RenderTargetStats
Allocation counters of a RenderTargetCache.
RenderTextureRecycler
Returns displayed textures to a RenderTargetCache once the UI no longer shows them.
RenderedTexture
A rendered Rgba8UnormSrgb texture and an Rgba8Unorm view of it for UI toolkits that sample without conversion.

Enums§

GpuError
Why a GPU operation failed.

Functions§

block_on
Runs future to completion on the current thread by polling it in a yielding loop.
mesh_budget
Scene budget derived from the device: one vertex and one index buffer must fit max_buffer_size, capped at 8M vertices and 16M triangles and never below MeshBudget::default.
render_offscreen
Opens the default high-performance adapter, renders scene into a 1..=4096 pixel image and reads it back. For export and device checks; interactive views keep textures on the GPU with render_texture_cached.
render_offscreen_with
Renders scene on an existing device and reads back RGBA; opens no adapter. The size is limited by the device’s texture limit.
render_texture
Renders prepared into a new width x height texture and waits for the GPU.
render_texture_cached
Like render_texture, reusing the depth texture and recycled color textures of targets. The renderer must target Rgba8UnormSrgb.