Expand description
Render effects that can be applied to graphics layers.
Matches the Jetpack Compose RenderEffect API with extensions for custom
WGSL shaders (RuntimeShader).
Structs§
- Blurred
Edge Treatment - Controls blur behavior outside source bounds.
- Draw
Specialization - The pipeline specialization one draw of a
RuntimeShadercompiles, chosen byRuntimeShader::draw_specialization. - Placeholder
Shape - A rounded rectangle within a layer.
- Runtime
Shader - A custom WGSL shader effect, analogous to Android’s
RuntimeShader. - Shader
Placeholder - What a renderer draws in place of a shader’s effect while the shader’s pipelines compile, so no frame waits for them.
- Shader
Warm Up - A runtime shader to compile before its first draw, at the target it will draw to, so a renderer’s background compiler builds the pipeline at start instead of inside the frame that first needs it.
Enums§
- Render
Effect - A render effect applied to a graphics layer’s rendered content.
- Runtime
Shader Uniform Error - Error returned when a shader uniform write targets renderer-owned storage.
- Shader
Target - Where a runtime shader’s pipeline draws, which decides how its output
blends:
Pagecomposites the shader over what lies beneath (a backdrop effect, or a render effect the renderer draws straight onto the page),Layerrenders into the layer’s own texture, whose content the shader replaces (a render effect under a blend mode or clip the page draw cannot apply, such as aDstOutmask). - Substrate
Spec - A low-frequency copy of a shader’s source the renderer packs beside it and hands the shader through a reserved substrate region slot.
- Tile
Mode - Edge treatment for blur effects at the boundary of the blurred region.
Constants§
- MAX_
SUBSTRATES - The most substrates one shader may declare.
- RUNTIME_
SHADER_ PRELUDE_ WGSL - The vertex stage and bindings every runtime shader starts from: a quad
whose
uvspans the effect’s rect, the input texture and sampler at group 0, and the 64 uniform vectors at group 1, which both stages read. A shader source is this prelude followed by aneffect_fsfragment stage.
Functions§
- runtime_
shader_ overrides_ hash - The hash
DrawSpecialization::overrides_hashgives a non-empty override set, its overrides in name order. - runtime_
shader_ source_ hash - The hash
RuntimeShader::source_hashgives a shader built fromsource.