Skip to main content

Crate alpha2_render

Crate alpha2_render 

Source
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§

AdapterDiagnostics
Adapter metadata recorded beside reproducible benchmark samples.
BenchmarkMetadata
Reproducible metadata envelope written beside benchmark measurements.
Color
A premultiplied sRGB storage value in 0..=1 with no color component above alpha; what an intermediate texture holds, not linear light.
CompiledEffect
A compiled runtime effect, ready for Renderer::register_compiled on the same renderer.
CpuImage
A CPU picture of premultiplied sRGB RGBA, like every GPU intermediate.
CpuRenderStats
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.
DegradationDecision
Effective controls and every observable fallback decision.
EffectDef
Data-only runtime effect, transition, or generator definition.
EffectId
Stable identity of one registered effect version.
EffectInputs
Named images an effect node samples besides its source, sorted by name, one node per name.
EffectParams
Named values for one runtime effect invocation, sorted by name, one value per name.
EffectResources
Named resource identities supplied to one effect invocation.
EffectRuntime
Per-invocation values supplied by the timeline runner.
FrameCost
A frame’s predicted cost in unit pixels per kind of work.
FrameGpuTimes
What the sampled frames of an export measured.
FrameMark
The frame a submission belongs to, as its caller knows it.
FrameSubmissions
How one frame was submitted, as the renderer planned it.
FrameSubmitTimings
Where one frame’s graph construction and submission spent its time.
GpuErrorReports
GPU errors the embedding saw outside the renderer’s scopes (in a browser, all of them).
GpuSubmissionStats
How frames since the last crate::Renderer::take_gpu_submission_stats were split into submissions.
GraphLayer
One owned layer reference in a graph composition node.
InputSpec
An extra image an effect samples, read as sample_<name>(uv) and size_<name>().
LayerTransform
Placement and opacity of one composited layer.
LossClassifier
Classifies a loss by the submission times of its renderer.
Lut3dData
Canonical RGB samples for one cubic 3D lookup table.
LutParseError
Diagnostic returned while parsing .cube text.
MaskCombineNames
Names of one mask’s coverage input and parameters in mask_combine_definition.
PaintParams
Parameter names of one paint in generator_definition.
ParamSpec
One runtime effect parameter.
PassTiming
Most recent timing for one named render pass.
PendingEffect
A runtime effect created on the device, awaiting the device’s verdict.
PendingSourceWork
One source-presentation pass waiting to be encoded by its first consumer.
PipelineCacheStats
Current pipeline-cache occupancy.
PipelineCreation
One pipeline creation for tracing.
PipelineCreationStats
Pipelines this renderer created and the time it took.
PlaneTarget
A caller-owned destination for one packed plane.
PreparedSourceTexture
A rendered source texture plus presentation work its first consumer’s encoder runs.
ReadbackBufferPoolStats
Allocation and retention counters for mapped readback buffers.
RenderCacheKey
Deterministic 128-bit key for a source or rendered graph result.
RenderDiagnostics
Snapshot of render performance, cache, memory, and scheduling behavior.
RenderGraph
An insertion-ordered, acyclic render program.
RenderNodeId
Stable handle to a node within one render graph.
RenderPlan
Compiled execution and lifetime schedule for a render graph.
RenderQualityControls
Quality controls consumed by graph compilation and pass execution.
RenderSize
A non-zero render-target extent.
RenderedTexture
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.
ResourceBudget
Caller-owned resource envelope; zero means the corresponding resource is unavailable.
ResourceSpec
One named external resource required by an effect definition.
ResultCacheStats
Result-cache counters since the renderer was created.
Rgba8Readback
A submitted texture readback whose buffer has not been mapped yet.
ShaderDiagnostic
One schema or WGSL diagnostic.
ShaderDiagnostics
Diagnostics returned when runtime registration fails.
SourcePlane
One borrowed source plane: rows stride bytes apart.
SourcePresentation
GPU presentation transform applied while converting a decoded source.
SourceView
A borrowed source picture: on the GPU a RenderedTexture, an crate::UploadTexture, or (via wgpu interop) any view on the renderer’s device; on the CPU a crate::CpuSource.
StagingPlane
Where one plane sits in a mapped readback staging buffer.
SubmissionReport
The longest recent submission and what it rendered.
TexturePoolStats
Observable allocation counters for the intermediate texture pool.
UniformBufferPoolStats
Allocation and retention counters for submission-scoped uniform arenas.
UniformField
Automatically computed uniform member placement.
UniformLayout
Host layout generated from a parameter schema.
UploadTexture
One source-upload texture retained by the renderer’s descriptor-keyed pool.
UploadTexturePoolStats
Allocation and retention counters for source-upload textures.
WarmupReport
Work completed by a graph warmup request.
Yuv420Frame
Borrowed 8-bit planar 4:2:0 source.
Yuv420pPlanes
Tightly packed planar YUV420 data produced by a GPU readback.
Yuv420pReadback
A submitted GPU RGB-to-YUV420 conversion whose buffer is not mapped yet.
Yuv420pTargets
Destinations for the three planes of one packed frame.
YuvFrame
Borrowed planar or semi-planar YCbCr source of any subsampling and depth YuvFormat::is_supported accepts.
YuvSample
A normalized YUV sample and straight alpha value.

Enums§

BlendMode
RGB blend operation applied before Porter-Duff source-over.
BlendSpace
Color space in which compositing arithmetic is evaluated.
CacheEligibility
Whether a node’s result can be cached, and if not, why.
CacheIntent
Whether a node’s result may be kept and reused.
CacheInvalidation
Why cached results were dropped all at once.
CapabilityDiagnostic
One deterministic fallback selected from adapter facts and caller budgets.
ColorDiagnostic
Observable color-pipeline diagnostic.
ColorError
Color conversion failure.
ColorPolicy
What happens to an HDR (PQ or HLG) source.
DiagnosticSeverity
Shader compiler message severity.
EffectKind
Runtime shader category.
EffectResourceKind
Representation an effect resource binding expects from its registered data.
GraphError
Structural or execution failure in a render graph.
ParamType
Host-side parameter representation.
ParamUnit
Semantic unit exposed to authoring hosts.
ParamValue
Typed default parameter value.
ReadbackFailure
Where a texture readback failed.
RenderError
Render input or output failure.
RenderNodeKind
Public category of a render graph node.
SdrOutputTransfer
SDR transfer used when encoding a render result.
SourceAlpha
How an RGBA source texture stores color relative to its alpha.
TimingSource
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 n masks is MASK_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 kind parameter.
PAINT_SPREADS
Enum values of a paint’s spread parameter.
TRACK_MATTE_EFFECT_ID
Internal identifier of the track-matte pass.

Traits§

EffectCatalog
Effect information a graph builder needs without drawing. The GPU Renderer and the crate::CpuRenderer answer from the same EffectDefs, so a frame compiles to the same graph on either.
ExternalTextureLease
Keeps an imported native texture and its decoder surface alive until the submission that samples it completes.
RenderControls
Controls a frame runner sets and reads on either renderer.
RgbaPixels
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_catalog for 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 color is 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 count masks (1 to MAX_SHAPE_MASKS) into its source’s coverage.
mask_combine_definitions
Every mask-combine pass, for one to MAX_SHAPE_MASKS masks.
pack_cpu_image
Packs picture into layout, 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.