Skip to main content

Crate frus_gpu

Crate frus_gpu 

Source
Expand description

frus-gpu — the GPU context and the 2D rendering engine.

This crate depends on no windowing library: it is handed a wgpu::SurfaceTarget by the platform layer — frus-shell, say — and takes care of everything else: device, queue, pipeline, presentation.

What is to be drawn is described in a Scene — coloured Rects and the rest — which is then handed to Renderer::render.

Re-exports§

pub use wgpu;

Structs§

Color
An RGBA colour. Components lie in [0.0, 1.0].
OffscreenFrame
A frame rendered offscreen: sRGB RGBA bytes, row by row.
Rect
An axis-aligned rectangle, in logical pixels.
Renderer
Holds the GPU state bound to a surface and presents the frames.
Scene
A 2D scene: the declarative description of what to draw.

Enums§

RenderOutcome
What happened when Renderer::render tried to present a frame.

Functions§

draw_calls
How many draw calls a scene’s rectangles, images and paths will cost.
render_offscreen
Renders scene into a width×height texture cleared to clear, then reads the pixels back. None when no GPU adapter is available — a machine with neither GPU nor software rasteriser — in which case test callers skip themselves.