Function choose_clip_render_mode

Source
pub fn choose_clip_render_mode(
    clip: Option<&ClipShape>,
    is_window_root: bool,
    draw_cmd_count: usize,
) -> ClipRenderMode
Expand description

Picks the GPU clip strategy for a layer.

None and rectangular clips always use scissor. A window-root rounded clip always uses stencil unless a force environment variable overrides it. For a non-root rounded clip, command counts above STENCIL_DRAW_CMD_THRESHOLD use stencil and smaller layers use a shader mask. If both force variables are true, the shader override wins.

ยงExamples

use ailloli_ui_render_wgpu::{choose_clip_render_mode, ClipRenderMode};
assert_eq!(choose_clip_render_mode(None, false, 100), ClipRenderMode::Scissor);