Skip to main content

ui_variant

Function ui_variant 

Source
pub fn ui_variant(
    srgb_to_linear_output: bool,
    surface: SurfaceKey,
) -> LitVariant
Available on crate feature egui only.
Expand description

The pipeline variant a UI is drawn with.

srgb_to_linear_output is the caller’s call, not this function’s: it depends on the target’s format, which this function never sees. Set it when the target encodes sRGB.

Every UI draw has the same shape: full-precision screen-space vertices carrying a premultiplied color and a texture coordinate, no skinning and no morph target, and a base-color texture sampled through a material group. What changes with the target is the surface the variant carries, so this is the only place a UI variant is built.