euv_core/scene/damage/struct.rs
1use super::*;
2
3/// Visible portal or backdrop-blur surface descriptor evaluated by surgical `effect_dependency_damage`.
4#[derive(Clone, Copy, Data, Debug, Default, New, PartialEq)]
5pub struct PortalBackdropRegion {
6 /// Screen-space logical bounds of the visible portal or backdrop node.
7 #[get(type(copy))]
8 pub(crate) bounds: Rect,
9 /// Backdrop blur radius in logical pixels (`0.0` for non-blurred portals).
10 #[get(type(copy))]
11 pub(crate) blur_radius: f32,
12 /// True when the portal or backdrop node itself was mutated on this frame.
13 #[get(type(copy))]
14 pub(crate) is_dirty: bool,
15}
16
17/// Summary report emitted by `effect_dependency_damage` quantifying surgical portal/backdrop expansions.
18#[derive(Clone, Copy, Data, Debug, Default, Eq, Hash, New, PartialEq)]
19pub struct EffectDamageReport {
20 /// Number of intersecting or dirty portal/backdrop regions expanded into the dirty set.
21 #[get(type(copy))]
22 pub(crate) expanded_regions: usize,
23 /// Number of visible portal/backdrop regions skipped because no dirty rect intersected their sampling halo.
24 #[get(type(copy))]
25 pub(crate) skipped_regions: usize,
26 /// True when an expanded portal/backdrop caused the dirty set to cover the entire viewport.
27 #[get(type(copy))]
28 pub(crate) escalated_full_frame: bool,
29}
30
31/// Bounded zero-allocation multi-rect dirty set tracking up to 16 disjoint physical damage rectangles.
32#[derive(Clone, Copy, Data, Debug, PartialEq)]
33pub struct DirtyRectSet {
34 /// Inline fixed-capacity array of normalized physical damage rectangles (`0..len` valid).
35 #[get(skip)]
36 #[get_mut(skip)]
37 #[set(skip)]
38 pub(crate) rects: [Rect; DIRTY_RECT_SET_CAPACITY],
39 /// Count of active valid rectangles in `rects` (`0..=16`).
40 #[get(type(copy))]
41 #[get_mut(skip)]
42 #[set(skip)]
43 pub(crate) len: usize,
44 /// True when full-viewport damage has been explicitly requested or promoted.
45 #[get(type(copy))]
46 pub(crate) full_frame: bool,
47 /// True when incoming rects exceeded inline capacity and required conservative full-frame fallback.
48 #[get(type(copy))]
49 pub(crate) overflowed: bool,
50}