Expand description
GPU compositing public API.
§wgpu interop
By default the API names no wgpu type: sources enter as SourceViews and results leave
as RenderedTextures and readbacks. Items taking or returning wgpu handles are
documented only with the wgpu-interop feature, track wgpu’s major version, and are
otherwise hidden and not part of this crate’s API.
Re-exports§
pub use composite::LayerTransform;pub use readback::PlaneTarget;pub use readback::Rgba8Readback;pub use readback::StagingPlane;pub use readback::Yuv420pPlanes;pub use readback::Yuv420pReadback;pub use readback::Yuv420pTargets;pub use readback::yuv420p_staging_bytes;pub use yuv::ExternalTextureLease;pub use yuv::PendingSourceWork;pub use yuv::PreparedSourceTexture;pub use yuv::SourceAlpha;pub use yuv::SourcePlane;pub use yuv::SourcePresentation;pub use yuv::Yuv420Frame;pub use yuv::YuvFrame;
Modules§
- hdr
- HDR sources brought into the SDR working space.
Structs§
- Adapter
Diagnostics - Adapter metadata recorded beside reproducible benchmark samples.
- Benchmark
Metadata - Reproducible metadata envelope written beside benchmark measurements.
- Color
- A premultiplied sRGB storage value in
0..=1with no color component above alpha; what an intermediate texture holds, not linear light. - Compiled
Effect - A compiled runtime effect, ready for
Renderer::register_compiledon the same renderer. - CpuImage
- A CPU picture of premultiplied sRGB RGBA, like every GPU intermediate.
- CpuRender
Stats - Counts of what the CPU renderer has drawn, for metrics.
- CpuRenderer
- A renderer that draws
RenderGraphs on the CPU with no GPU or driver. - CpuSource
- A CPU graph source (
crate::SourceView::cpu) holding premultiplied sRGB RGBA, like every GPU source texture. Decoded frames convert on first draw and the result is kept. - Degradation
Decision - Effective controls and every observable fallback decision.
- Effect
Def - Data-only runtime effect, transition, or generator definition.
- Effect
Id - Stable identity of one registered effect version.
- Effect
Inputs - Named images an effect node samples besides its source, sorted by name, one node per name.
- Effect
Params - Named values for one runtime effect invocation, sorted by name, one value per name.
- Effect
Resources - Named resource identities supplied to one effect invocation.
- Effect
Runtime - Per-invocation values supplied by the timeline runner.
- Frame
Cost - A frame’s predicted cost in unit pixels per kind of work.
- Frame
GpuTimes - What the sampled frames of an export measured.
- Frame
Mark - The frame a submission belongs to, as its caller knows it.
- Frame
Submissions - How one frame was submitted, as the renderer planned it.
- Frame
Submit Timings - Where one frame’s graph construction and submission spent its time.
- GpuError
Reports - GPU errors the embedding saw outside the renderer’s scopes (in a browser, all of them).
- GpuSubmission
Stats - How frames since the last
crate::Renderer::take_gpu_submission_statswere split into submissions. - Graph
Layer - One owned layer reference in a graph composition node.
- Input
Spec - An extra image an effect samples, read as
sample_<name>(uv)andsize_<name>(). - Layer
Transform - Placement and opacity of one composited layer.
- Loss
Classifier - Classifies a loss by the submission times of its renderer.
- Lut3d
Data - Canonical RGB samples for one cubic 3D lookup table.
- LutParse
Error - Diagnostic returned while parsing
.cubetext. - Mask
Combine Names - Names of one mask’s coverage input and parameters in
mask_combine_definition. - Paint
Params - Parameter names of one paint in
generator_definition. - Param
Spec - One runtime effect parameter.
- Pass
Timing - Most recent timing for one named render pass.
- Pending
Effect - A runtime effect created on the device, awaiting the device’s verdict.
- Pending
Source Work - One source-presentation pass waiting to be encoded by its first consumer.
- Pipeline
Cache Stats - Current pipeline-cache occupancy.
- Pipeline
Creation - One pipeline creation for tracing.
- Pipeline
Creation Stats - Pipelines this renderer created and the time it took.
- Plane
Target - A caller-owned destination for one packed plane.
- Prepared
Source Texture - A rendered source texture plus presentation work its first consumer’s encoder runs.
- Readback
Buffer Pool Stats - Allocation and retention counters for mapped readback buffers.
- Render
Cache Key - Deterministic 128-bit key for a source or rendered graph result.
- Render
Diagnostics - Snapshot of render performance, cache, memory, and scheduling behavior.
- Render
Graph - An insertion-ordered, acyclic render program.
- Render
Node Id - Stable handle to a node within one render graph.
- Render
Plan - Compiled execution and lifetime schedule for a render graph.
- Render
Quality Controls - Quality controls consumed by graph compilation and pass execution.
- Render
Size - A non-zero render-target extent.
- Rendered
Texture - A GPU texture produced by the renderer, storing premultiplied sRGB RGBA (solid clears keep the given values).
- Renderer
- Renders graphs of sources, effects, transitions and composites on one GPU device, and owns the pipelines, pools and caches they use.
- Resource
Budget - Caller-owned resource envelope; zero means the corresponding resource is unavailable.
- Resource
Spec - One named external resource required by an effect definition.
- Result
Cache Stats - Result-cache counters since the renderer was created.
- Rgba8
Readback - A submitted texture readback whose buffer has not been mapped yet.
- Shader
Diagnostic - One schema or WGSL diagnostic.
- Shader
Diagnostics - Diagnostics returned when runtime registration fails.
- Source
Plane - One borrowed source plane: rows
stridebytes apart. - Source
Presentation - GPU presentation transform applied while converting a decoded source.
- Source
View - A borrowed source picture: on the GPU a
RenderedTexture, ancrate::UploadTexture, or (viawgpuinterop) any view on the renderer’s device; on the CPU acrate::CpuSource. - Staging
Plane - Where one plane sits in a mapped readback staging buffer.
- Submission
Report - The longest recent submission and what it rendered.
- Texture
Pool Stats - Observable allocation counters for the intermediate texture pool.
- Uniform
Buffer Pool Stats - Allocation and retention counters for submission-scoped uniform arenas.
- Uniform
Field - Automatically computed uniform member placement.
- Uniform
Layout - Host layout generated from a parameter schema.
- Upload
Texture - One source-upload texture retained by the renderer’s descriptor-keyed pool.
- Upload
Texture Pool Stats - Allocation and retention counters for source-upload textures.
- Warmup
Report - Work completed by a graph warmup request.
- Yuv420
Frame - Borrowed 8-bit planar 4:2:0 source.
- Yuv420p
Planes - Tightly packed planar YUV420 data produced by a GPU readback.
- Yuv420p
Readback - A submitted GPU RGB-to-YUV420 conversion whose buffer is not mapped yet.
- Yuv420p
Targets - Destinations for the three planes of one packed frame.
- YuvFrame
- Borrowed planar or semi-planar YCbCr source of any subsampling and depth
YuvFormat::is_supportedaccepts. - YuvSample
- A normalized YUV sample and straight alpha value.
Enums§
- Blend
Mode - RGB blend operation applied before Porter-Duff source-over.
- Blend
Space - Color space in which compositing arithmetic is evaluated.
- Cache
Eligibility - Whether a node’s result can be cached, and if not, why.
- Cache
Intent - Whether a node’s result may be kept and reused.
- Cache
Invalidation - Why cached results were dropped all at once.
- Capability
Diagnostic - One deterministic fallback selected from adapter facts and caller budgets.
- Color
Diagnostic - Observable color-pipeline diagnostic.
- Color
Error - Color conversion failure.
- Color
Policy - What happens to an HDR (PQ or HLG) source.
- Diagnostic
Severity - Shader compiler message severity.
- Effect
Kind - Runtime shader category.
- Effect
Resource Kind - Representation an effect resource binding expects from its registered data.
- Graph
Error - Structural or execution failure in a render graph.
- Param
Type - Host-side parameter representation.
- Param
Unit - Semantic unit exposed to authoring hosts.
- Param
Value - Typed default parameter value.
- Readback
Failure - Where a texture readback failed.
- Render
Error - Render input or output failure.
- Render
Node Kind - Public category of a render graph node.
- SdrOutput
Transfer - SDR transfer used when encoding a render result.
- Source
Alpha - How an RGBA source texture stores color relative to its alpha.
- Timing
Source - Source of one pass duration.
Constants§
- CHROMA_
KEY_ ID - Stable identifier of the built-in chroma-key effect.
- DEFAULT_
GPU_ WAIT_ TIMEOUT - Default native wait for GPU work before giving up.
- FILL_
PAINT_ PARAMS - The fill paint’s parameter names, static so callers need not format them.
- GAUSSIAN_
BLUR_ ID - Stable identifier of the atomic Gaussian-blur effect.
- GENERATOR_
EFFECT_ ID - Internal identifier of the generator pass.
- GLOW_ID
- Stable identifier of the built-in glow effect.
- GPU_
DEVICE_ LOST_ MESSAGE - The message of
RenderError::GpuDeviceLost. - GPU_
TIMEOUT_ MESSAGE - Message every GPU wait timeout carries, so hosts can classify errors from text alone.
The message every timed-out GPU wait carries, so hosts that see only error text can classify
it as
GPU_TIMEOUT. - GPU_
WORK_ DROPPED_ MESSAGE - Message of
RenderError::GpuWorkDropped; names a lost device, as hosts classify it. - LUT_
3D_ ID - Stable identifier of the resource-backed 3D LUT effect.
- MASK_
COMBINE_ EFFECT_ IDS - Mask-combine pass ids; the pass for
nmasks isMASK_COMBINE_EFFECT_IDS[n - 1]. - MASK_
COMBINE_ NAMES - Each mask’s names by index, static so callers need not format them.
- MASK_
MODES - Enum values of a mask’s
mode{i}parameter. - MAX_
EFFECT_ INPUTS - Most named inputs an effect declares. Source pair, resources and inputs must also fit the device’s sampled textures per stage (16 on WebGL2-class limits), checked at registration.
- MAX_
GENERATOR_ STOPS - Most stops per paint.
- MAX_
SHAPE_ MASKS - Most masks one mask-combine pass takes, each a named input.
- PAINT_
KINDS - Enum values of a paint’s
kindparameter. - PAINT_
SPREADS - Enum values of a paint’s
spreadparameter. - TRACK_
MATTE_ EFFECT_ ID - Internal identifier of the track-matte pass.
Traits§
- Effect
Catalog - Effect information a graph builder needs without drawing. The GPU
Rendererand thecrate::CpuRendereranswer from the sameEffectDefs, so a frame compiles to the same graph on either. - External
Texture Lease - Keeps an imported native texture and its decoder surface alive until the submission that samples it completes.
- Render
Controls - Controls a frame runner sets and reads on either renderer.
- Rgba
Pixels - RGBA pixels a source converts from: 8-bit, or half-float bits for linear sources.
- YuvPlanes
- Decoded YCbCr planes owned by the decoder and kept unchanged while any source holds them.
Functions§
- blur_
sigma_ pixels - Standard deviation in pixels of the built-in blur of
radius: half the radius, as a fraction of the shorter side. - builtin_
catalog - The engine-owned effect catalog as JSON, without shader source.
- builtin_
catalog_ json - Serializes
builtin_catalogfor process and WebAssembly boundaries. - builtin_
effect_ definitions - Returns fresh definitions for every public built-in clip effect.
- builtin_
transition_ definitions - Returns fresh, data-only definitions for all built-in transitions.
- builtin_
wgsl_ modules - Every labelled WGSL module the renderer can create: built-in pipelines plus each built-in effect’s and transition’s generated module.
- chroma_
key_ definition - Returns the data-only definition of the built-in chroma-key effect.
- convert_
yuv_ to_ linear_ rgba - Converts one integer-code-normalized YUV sample to premultiplied linear RGB.
- effect_
wgsl - The full module compiled for
definition: generated preamble plus body. - encode_
linear_ rgb - Encodes linear-light RGB for an SDR output target.
- filter_
sample_ limit - Most filter samples a pass takes on
tier:crate::RenderQualityControls::MAX_FILTER_SAMPLES, or 16 on Tier B (WebGL2, GL ES), whose fill rate cannot keep up with more. - gaussian_
blur_ definition - Returns the data-only definition of the built-in Gaussian blur.
- generator_
definition - The generator pass: the fill paint over the whole picture.
- glow_
definition - Returns the data-only definition of the built-in glow.
- is_hdr
- Whether
coloris an HDR signal: PQ or HLG, or declared HDR. - lut_
3d_ definition - Returns the data-only definition of the resource-backed 3D LUT effect.
- mask_
combine_ definition - The pass combining
countmasks (1 toMAX_SHAPE_MASKS) into its source’s coverage. - mask_
combine_ definitions - Every mask-combine pass, for one to
MAX_SHAPE_MASKSmasks. - pack_
cpu_ image - Packs
pictureintolayout, one target per plane in storage order (alpha2_media::PixelLayout::planes), as the GPU texel readback does (crate::Yuv420pReadback::finish_into_planes). - resolve_
degradation - Resolves deterministic degradation without product- or device-name assumptions.
- track_
matte_ definition - The track-matte pass: keeps the first input where the second’s alpha (or luminance over black, BT.709 weights on linear light times alpha) says, optionally inverted.
- yuv420p_
staging_ bytes - Staging bytes of one planar YUV420 readback of
size, including row padding, plane alignment and the 16-byte canary. A budget must reserve this per in-flight readback.