atagen

monolith

public
Star0
Watch0
6482fe98839d4f1846dbcbad0cec3972389d53c8
1
ssh://brewery@pls.lobotomise.me:33/atagen/monolith.git

Blame: crates/render-vk/src/frame.rs

824bf02b6e55atagen2026-10-16 09:15 UTC1
use crate::Error;
824bf02b6e55atagen2026-10-16 09:15 UTC2
use crate::image::{VulkanTarget, VulkanTexture};
824bf02b6e55atagen2026-10-16 09:15 UTC3
use crate::pipeline::{Kind, Push};
824bf02b6e55atagen2026-10-16 09:15 UTC4
use crate::renderer::VulkanRenderer;
824bf02b6e55atagen2026-10-16 09:15 UTC5
use crate::transform::{rect_to_framebuffer, texture_uvs, to_framebuffer};
824bf02b6e55atagen2026-10-16 09:15 UTC6
use ash::vk;
824bf02b6e55atagen2026-10-16 09:15 UTC7
use smithay::backend::renderer::sync::SyncPoint;
824bf02b6e55atagen2026-10-16 09:15 UTC8
use smithay::backend::renderer::{Color32F, ContextId, Frame, Texture};
824bf02b6e55atagen2026-10-16 09:15 UTC9
use smithay::utils::{Buffer, Physical, Rectangle, Size, Transform};
824bf02b6e55atagen2026-10-16 09:15 UTC10
use std::sync::Arc;
824bf02b6e55atagen2026-10-16 09:15 UTC11
824bf02b6e55atagen2026-10-16 09:15 UTC12
pub(crate) enum Op {
824bf02b6e55atagen2026-10-16 09:15 UTC13
    Clear {
824bf02b6e55atagen2026-10-16 09:15 UTC14
        color: [f32; 4],
824bf02b6e55atagen2026-10-16 09:15 UTC15
        rects: Vec<vk::Rect2D>,
824bf02b6e55atagen2026-10-16 09:15 UTC16
    },
824bf02b6e55atagen2026-10-16 09:15 UTC17
    Draw {
824bf02b6e55atagen2026-10-16 09:15 UTC18
        kind: Kind,
824bf02b6e55atagen2026-10-16 09:15 UTC19
        texture: Option<VulkanTexture>,
824bf02b6e55atagen2026-10-16 09:15 UTC20
        push: Push,
824bf02b6e55atagen2026-10-16 09:15 UTC21
        scissors: Vec<vk::Rect2D>,
824bf02b6e55atagen2026-10-16 09:15 UTC22
    },
824bf02b6e55atagen2026-10-16 09:15 UTC23
}
824bf02b6e55atagen2026-10-16 09:15 UTC24
824bf02b6e55atagen2026-10-16 09:15 UTC25
/// A frame in progress. Draws are recorded and submitted together by [`Frame::finish`].
824bf02b6e55atagen2026-10-16 09:15 UTC26
pub struct VulkanFrame<'frame, 'buffer> {
824bf02b6e55atagen2026-10-16 09:15 UTC27
    renderer: &'frame mut VulkanRenderer,
824bf02b6e55atagen2026-10-16 09:15 UTC28
    target: &'frame mut VulkanTarget<'buffer>,
824bf02b6e55atagen2026-10-16 09:15 UTC29
    output: Size<i32, Physical>,
824bf02b6e55atagen2026-10-16 09:15 UTC30
    transform: Transform,
824bf02b6e55atagen2026-10-16 09:15 UTC31
    ops: Vec<Op>,
824bf02b6e55atagen2026-10-16 09:15 UTC32
}
824bf02b6e55atagen2026-10-16 09:15 UTC33
824bf02b6e55atagen2026-10-16 09:15 UTC34
impl std::fmt::Debug for VulkanFrame<'_, '_> {
824bf02b6e55atagen2026-10-16 09:15 UTC35
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
824bf02b6e55atagen2026-10-16 09:15 UTC36
        f.debug_struct("VulkanFrame")
824bf02b6e55atagen2026-10-16 09:15 UTC37
            .field("output", &self.output)
824bf02b6e55atagen2026-10-16 09:15 UTC38
            .field("ops", &self.ops.len())
824bf02b6e55atagen2026-10-16 09:15 UTC39
            .finish()
824bf02b6e55atagen2026-10-16 09:15 UTC40
    }
824bf02b6e55atagen2026-10-16 09:15 UTC41
}
824bf02b6e55atagen2026-10-16 09:15 UTC42
824bf02b6e55atagen2026-10-16 09:15 UTC43
impl<'frame, 'buffer> VulkanFrame<'frame, 'buffer> {
824bf02b6e55atagen2026-10-16 09:15 UTC44
    pub(crate) fn new(
824bf02b6e55atagen2026-10-16 09:15 UTC45
        renderer: &'frame mut VulkanRenderer,
824bf02b6e55atagen2026-10-16 09:15 UTC46
        target: &'frame mut VulkanTarget<'buffer>,
824bf02b6e55atagen2026-10-16 09:15 UTC47
        output: Size<i32, Physical>,
824bf02b6e55atagen2026-10-16 09:15 UTC48
        transform: Transform,
824bf02b6e55atagen2026-10-16 09:15 UTC49
    ) -> Self {
824bf02b6e55atagen2026-10-16 09:15 UTC50
        Self {
824bf02b6e55atagen2026-10-16 09:15 UTC51
            renderer,
824bf02b6e55atagen2026-10-16 09:15 UTC52
            target,
824bf02b6e55atagen2026-10-16 09:15 UTC53
            output,
824bf02b6e55atagen2026-10-16 09:15 UTC54
            transform,
824bf02b6e55atagen2026-10-16 09:15 UTC55
            ops: Vec::new(),
824bf02b6e55atagen2026-10-16 09:15 UTC56
        }
824bf02b6e55atagen2026-10-16 09:15 UTC57
    }
824bf02b6e55atagen2026-10-16 09:15 UTC58
824bf02b6e55atagen2026-10-16 09:15 UTC59
    fn fb_size(&self) -> Size<i32, Physical> {
824bf02b6e55atagen2026-10-16 09:15 UTC60
        (self.target.width() as i32, self.target.height() as i32).into()
824bf02b6e55atagen2026-10-16 09:15 UTC61
    }
824bf02b6e55atagen2026-10-16 09:15 UTC62
824bf02b6e55atagen2026-10-16 09:15 UTC63
    fn fb_rect(&self, r: Rectangle<i32, Physical>) -> Option<vk::Rect2D> {
824bf02b6e55atagen2026-10-16 09:15 UTC64
        let r = rect_to_framebuffer(r, self.output, self.transform)
824bf02b6e55atagen2026-10-16 09:15 UTC65
            .intersection(Rectangle::from_size(self.fb_size()))?;
824bf02b6e55atagen2026-10-16 09:15 UTC66
        Some(vk::Rect2D {
824bf02b6e55atagen2026-10-16 09:15 UTC67
            offset: vk::Offset2D {
824bf02b6e55atagen2026-10-16 09:15 UTC68
                x: r.loc.x,
824bf02b6e55atagen2026-10-16 09:15 UTC69
                y: r.loc.y,
824bf02b6e55atagen2026-10-16 09:15 UTC70
            },
824bf02b6e55atagen2026-10-16 09:15 UTC71
            extent: vk::Extent2D {
824bf02b6e55atagen2026-10-16 09:15 UTC72
                width: r.size.w as u32,
824bf02b6e55atagen2026-10-16 09:15 UTC73
                height: r.size.h as u32,
824bf02b6e55atagen2026-10-16 09:15 UTC74
            },
824bf02b6e55atagen2026-10-16 09:15 UTC75
        })
824bf02b6e55atagen2026-10-16 09:15 UTC76
    }
824bf02b6e55atagen2026-10-16 09:15 UTC77
824bf02b6e55atagen2026-10-16 09:15 UTC78
    fn scissors(
824bf02b6e55atagen2026-10-16 09:15 UTC79
        &self,
824bf02b6e55atagen2026-10-16 09:15 UTC80
        dst: Rectangle<i32, Physical>,
824bf02b6e55atagen2026-10-16 09:15 UTC81
        damage: &[Rectangle<i32, Physical>],
824bf02b6e55atagen2026-10-16 09:15 UTC82
    ) -> Vec<vk::Rect2D> {
824bf02b6e55atagen2026-10-16 09:15 UTC83
        damage
824bf02b6e55atagen2026-10-16 09:15 UTC84
            .iter()
824bf02b6e55atagen2026-10-16 09:15 UTC85
            .filter_map(|d| d.intersection(Rectangle::from_size(dst.size)))
824bf02b6e55atagen2026-10-16 09:15 UTC86
            .filter_map(|mut d| {
824bf02b6e55atagen2026-10-16 09:15 UTC87
                d.loc += dst.loc;
824bf02b6e55atagen2026-10-16 09:15 UTC88
                self.fb_rect(d)
824bf02b6e55atagen2026-10-16 09:15 UTC89
            })
824bf02b6e55atagen2026-10-16 09:15 UTC90
            .collect()
824bf02b6e55atagen2026-10-16 09:15 UTC91
    }
824bf02b6e55atagen2026-10-16 09:15 UTC92
96db497859dcatagen2026-10-16 11:27 UTC93
    /// Draws a texture through the transition hook in `shaders/effect.frag`.
96db497859dcatagen2026-10-16 11:27 UTC94
    #[expect(clippy::too_many_arguments)]
96db497859dcatagen2026-10-16 11:27 UTC95
    pub fn render_effect(
96db497859dcatagen2026-10-16 11:27 UTC96
        &mut self,
96db497859dcatagen2026-10-16 11:27 UTC97
        texture: &VulkanTexture,
96db497859dcatagen2026-10-16 11:27 UTC98
        src: Rectangle<f64, Buffer>,
96db497859dcatagen2026-10-16 11:27 UTC99
        dst: Rectangle<i32, Physical>,
96db497859dcatagen2026-10-16 11:27 UTC100
        damage: &[Rectangle<i32, Physical>],
96db497859dcatagen2026-10-16 11:27 UTC101
        src_transform: Transform,
96db497859dcatagen2026-10-16 11:27 UTC102
        alpha: f32,
96db497859dcatagen2026-10-16 11:27 UTC103
        effect: Effect,
96db497859dcatagen2026-10-16 11:27 UTC104
    ) -> Result<(), Error> {
96db497859dcatagen2026-10-16 11:27 UTC105
        let params = [effect.progress, effect.kind as u32 as f32, 0.0, 0.0];
96db497859dcatagen2026-10-16 11:27 UTC106
        self.draw_texture(
96db497859dcatagen2026-10-16 11:27 UTC107
            texture,
96db497859dcatagen2026-10-16 11:27 UTC108
            src,
96db497859dcatagen2026-10-16 11:27 UTC109
            dst,
96db497859dcatagen2026-10-16 11:27 UTC110
            damage,
96db497859dcatagen2026-10-16 11:27 UTC111
            src_transform,
96db497859dcatagen2026-10-16 11:27 UTC112
            alpha,
96db497859dcatagen2026-10-16 11:27 UTC113
            Kind::Effect,
96db497859dcatagen2026-10-16 11:27 UTC114
            params,
96db497859dcatagen2026-10-16 11:27 UTC115
        )
96db497859dcatagen2026-10-16 11:27 UTC116
    }
96db497859dcatagen2026-10-16 11:27 UTC117
96db497859dcatagen2026-10-16 11:27 UTC118
    #[expect(clippy::too_many_arguments)]
96db497859dcatagen2026-10-16 11:27 UTC119
    fn draw_texture(
96db497859dcatagen2026-10-16 11:27 UTC120
        &mut self,
96db497859dcatagen2026-10-16 11:27 UTC121
        texture: &VulkanTexture,
96db497859dcatagen2026-10-16 11:27 UTC122
        src: Rectangle<f64, Buffer>,
96db497859dcatagen2026-10-16 11:27 UTC123
        dst: Rectangle<i32, Physical>,
96db497859dcatagen2026-10-16 11:27 UTC124
        damage: &[Rectangle<i32, Physical>],
96db497859dcatagen2026-10-16 11:27 UTC125
        src_transform: Transform,
96db497859dcatagen2026-10-16 11:27 UTC126
        alpha: f32,
96db497859dcatagen2026-10-16 11:27 UTC127
        kind: Kind,
96db497859dcatagen2026-10-16 11:27 UTC128
        effect: [f32; 4],
96db497859dcatagen2026-10-16 11:27 UTC129
    ) -> Result<(), Error> {
96db497859dcatagen2026-10-16 11:27 UTC130
        if !Arc::ptr_eq(&texture.0.shared, self.renderer.shared()) {
96db497859dcatagen2026-10-16 11:27 UTC131
            return Err(Error::ForeignTexture);
96db497859dcatagen2026-10-16 11:27 UTC132
        }
96db497859dcatagen2026-10-16 11:27 UTC133
        if dst.size.w <= 0 || dst.size.h <= 0 || Arc::ptr_eq(&texture.0, &self.target.0) {
96db497859dcatagen2026-10-16 11:27 UTC134
            return Ok(());
96db497859dcatagen2026-10-16 11:27 UTC135
        }
96db497859dcatagen2026-10-16 11:27 UTC136
        let scissors = self.scissors(dst, damage);
96db497859dcatagen2026-10-16 11:27 UTC137
        if scissors.is_empty() {
96db497859dcatagen2026-10-16 11:27 UTC138
            return Ok(());
96db497859dcatagen2026-10-16 11:27 UTC139
        }
96db497859dcatagen2026-10-16 11:27 UTC140
        let uvs = texture_uvs(src, dst.size, texture.size(), src_transform);
96db497859dcatagen2026-10-16 11:27 UTC141
        let (fb, uv) = to_framebuffer(dst, uvs, self.output, self.transform);
96db497859dcatagen2026-10-16 11:27 UTC142
        let push = Push {
96db497859dcatagen2026-10-16 11:27 UTC143
            dst: self.ndc(fb),
96db497859dcatagen2026-10-16 11:27 UTC144
            uv,
96db497859dcatagen2026-10-16 11:27 UTC145
            color: [1.0, 1.0, 1.0, alpha],
96db497859dcatagen2026-10-16 11:27 UTC146
            effect,
96db497859dcatagen2026-10-16 11:27 UTC147
        };
96db497859dcatagen2026-10-16 11:27 UTC148
        self.ops.push(Op::Draw {
96db497859dcatagen2026-10-16 11:27 UTC149
            kind,
96db497859dcatagen2026-10-16 11:27 UTC150
            texture: Some(texture.clone()),
96db497859dcatagen2026-10-16 11:27 UTC151
            push,
96db497859dcatagen2026-10-16 11:27 UTC152
            scissors,
96db497859dcatagen2026-10-16 11:27 UTC153
        });
96db497859dcatagen2026-10-16 11:27 UTC154
        Ok(())
96db497859dcatagen2026-10-16 11:27 UTC155
    }
96db497859dcatagen2026-10-16 11:27 UTC156
824bf02b6e55atagen2026-10-16 09:15 UTC157
    fn ndc(&self, r: Rectangle<i32, Physical>) -> [f32; 4] {
824bf02b6e55atagen2026-10-16 09:15 UTC158
        let fb = self.fb_size();
824bf02b6e55atagen2026-10-16 09:15 UTC159
        let (w, h) = (fb.w as f32, fb.h as f32);
824bf02b6e55atagen2026-10-16 09:15 UTC160
        [
824bf02b6e55atagen2026-10-16 09:15 UTC161
            r.loc.x as f32 / w * 2.0 - 1.0,
824bf02b6e55atagen2026-10-16 09:15 UTC162
            r.loc.y as f32 / h * 2.0 - 1.0,
824bf02b6e55atagen2026-10-16 09:15 UTC163
            r.size.w as f32 / w * 2.0,
824bf02b6e55atagen2026-10-16 09:15 UTC164
            r.size.h as f32 / h * 2.0,
824bf02b6e55atagen2026-10-16 09:15 UTC165
        ]
824bf02b6e55atagen2026-10-16 09:15 UTC166
    }
824bf02b6e55atagen2026-10-16 09:15 UTC167
}
824bf02b6e55atagen2026-10-16 09:15 UTC168
824bf02b6e55atagen2026-10-16 09:15 UTC169
impl Frame for VulkanFrame<'_, '_> {
824bf02b6e55atagen2026-10-16 09:15 UTC170
    type Error = Error;
824bf02b6e55atagen2026-10-16 09:15 UTC171
    type TextureId = VulkanTexture;
824bf02b6e55atagen2026-10-16 09:15 UTC172
824bf02b6e55atagen2026-10-16 09:15 UTC173
    fn context_id(&self) -> ContextId<VulkanTexture> {
824bf02b6e55atagen2026-10-16 09:15 UTC174
        self.renderer.context_id_ref().clone()
824bf02b6e55atagen2026-10-16 09:15 UTC175
    }
824bf02b6e55atagen2026-10-16 09:15 UTC176
824bf02b6e55atagen2026-10-16 09:15 UTC177
    fn clear(&mut self, color: Color32F, at: &[Rectangle<i32, Physical>]) -> Result<(), Error> {
824bf02b6e55atagen2026-10-16 09:15 UTC178
        let rects: Vec<_> = at.iter().filter_map(|r| self.fb_rect(*r)).collect();
824bf02b6e55atagen2026-10-16 09:15 UTC179
        if !rects.is_empty() {
824bf02b6e55atagen2026-10-16 09:15 UTC180
            self.ops.push(Op::Clear {
824bf02b6e55atagen2026-10-16 09:15 UTC181
                color: color.components(),
824bf02b6e55atagen2026-10-16 09:15 UTC182
                rects,
824bf02b6e55atagen2026-10-16 09:15 UTC183
            });
824bf02b6e55atagen2026-10-16 09:15 UTC184
        }
824bf02b6e55atagen2026-10-16 09:15 UTC185
        Ok(())
824bf02b6e55atagen2026-10-16 09:15 UTC186
    }
824bf02b6e55atagen2026-10-16 09:15 UTC187
824bf02b6e55atagen2026-10-16 09:15 UTC188
    fn draw_solid(
824bf02b6e55atagen2026-10-16 09:15 UTC189
        &mut self,
824bf02b6e55atagen2026-10-16 09:15 UTC190
        dst: Rectangle<i32, Physical>,
824bf02b6e55atagen2026-10-16 09:15 UTC191
        damage: &[Rectangle<i32, Physical>],
824bf02b6e55atagen2026-10-16 09:15 UTC192
        color: Color32F,
824bf02b6e55atagen2026-10-16 09:15 UTC193
    ) -> Result<(), Error> {
824bf02b6e55atagen2026-10-16 09:15 UTC194
        let scissors = self.scissors(dst, damage);
824bf02b6e55atagen2026-10-16 09:15 UTC195
        if scissors.is_empty() {
824bf02b6e55atagen2026-10-16 09:15 UTC196
            return Ok(());
824bf02b6e55atagen2026-10-16 09:15 UTC197
        }
824bf02b6e55atagen2026-10-16 09:15 UTC198
        let (fb, _) = to_framebuffer(dst, [[0.0; 2]; 4], self.output, self.transform);
824bf02b6e55atagen2026-10-16 09:15 UTC199
        let push = Push {
824bf02b6e55atagen2026-10-16 09:15 UTC200
            dst: self.ndc(fb),
824bf02b6e55atagen2026-10-16 09:15 UTC201
            uv: [[0.0; 2]; 4],
824bf02b6e55atagen2026-10-16 09:15 UTC202
            color: color.components(),
96db497859dcatagen2026-10-16 11:27 UTC203
            effect: [0.0; 4],
824bf02b6e55atagen2026-10-16 09:15 UTC204
        };
824bf02b6e55atagen2026-10-16 09:15 UTC205
        self.ops.push(Op::Draw {
824bf02b6e55atagen2026-10-16 09:15 UTC206
            kind: Kind::Solid,
824bf02b6e55atagen2026-10-16 09:15 UTC207
            texture: None,
824bf02b6e55atagen2026-10-16 09:15 UTC208
            push,
824bf02b6e55atagen2026-10-16 09:15 UTC209
            scissors,
824bf02b6e55atagen2026-10-16 09:15 UTC210
        });
824bf02b6e55atagen2026-10-16 09:15 UTC211
        Ok(())
824bf02b6e55atagen2026-10-16 09:15 UTC212
    }
824bf02b6e55atagen2026-10-16 09:15 UTC213
824bf02b6e55atagen2026-10-16 09:15 UTC214
    fn render_texture_from_to(
824bf02b6e55atagen2026-10-16 09:15 UTC215
        &mut self,
824bf02b6e55atagen2026-10-16 09:15 UTC216
        texture: &VulkanTexture,
824bf02b6e55atagen2026-10-16 09:15 UTC217
        src: Rectangle<f64, Buffer>,
824bf02b6e55atagen2026-10-16 09:15 UTC218
        dst: Rectangle<i32, Physical>,
824bf02b6e55atagen2026-10-16 09:15 UTC219
        damage: &[Rectangle<i32, Physical>],
824bf02b6e55atagen2026-10-16 09:15 UTC220
        _opaque_regions: &[Rectangle<i32, Physical>],
824bf02b6e55atagen2026-10-16 09:15 UTC221
        src_transform: Transform,
824bf02b6e55atagen2026-10-16 09:15 UTC222
        alpha: f32,
824bf02b6e55atagen2026-10-16 09:15 UTC223
    ) -> Result<(), Error> {
96db497859dcatagen2026-10-16 11:27 UTC224
        self.draw_texture(
96db497859dcatagen2026-10-16 11:27 UTC225
            texture,
96db497859dcatagen2026-10-16 11:27 UTC226
            src,
96db497859dcatagen2026-10-16 11:27 UTC227
            dst,
96db497859dcatagen2026-10-16 11:27 UTC228
            damage,
96db497859dcatagen2026-10-16 11:27 UTC229
            src_transform,
96db497859dcatagen2026-10-16 11:27 UTC230
            alpha,
96db497859dcatagen2026-10-16 11:27 UTC231
            Kind::Texture,
96db497859dcatagen2026-10-16 11:27 UTC232
            [0.0; 4],
96db497859dcatagen2026-10-16 11:27 UTC233
        )
824bf02b6e55atagen2026-10-16 09:15 UTC234
    }
824bf02b6e55atagen2026-10-16 09:15 UTC235
824bf02b6e55atagen2026-10-16 09:15 UTC236
    fn transformation(&self) -> Transform {
824bf02b6e55atagen2026-10-16 09:15 UTC237
        self.transform
824bf02b6e55atagen2026-10-16 09:15 UTC238
    }
824bf02b6e55atagen2026-10-16 09:15 UTC239
824bf02b6e55atagen2026-10-16 09:15 UTC240
    fn output_size(&self) -> Size<i32, Physical> {
824bf02b6e55atagen2026-10-16 09:15 UTC241
        self.output
824bf02b6e55atagen2026-10-16 09:15 UTC242
    }
824bf02b6e55atagen2026-10-16 09:15 UTC243
824bf02b6e55atagen2026-10-16 09:15 UTC244
    fn wait(&mut self, sync: &SyncPoint) -> Result<(), Error> {
824bf02b6e55atagen2026-10-16 09:15 UTC245
        sync.wait().map_err(|_| Error::Interrupted)
824bf02b6e55atagen2026-10-16 09:15 UTC246
    }
824bf02b6e55atagen2026-10-16 09:15 UTC247
824bf02b6e55atagen2026-10-16 09:15 UTC248
    fn finish(mut self) -> Result<SyncPoint, Error> {
824bf02b6e55atagen2026-10-16 09:15 UTC249
        let ops = std::mem::take(&mut self.ops);
824bf02b6e55atagen2026-10-16 09:15 UTC250
        self.renderer.submit(self.target, ops)
824bf02b6e55atagen2026-10-16 09:15 UTC251
    }
824bf02b6e55atagen2026-10-16 09:15 UTC252
}
96db497859dcatagen2026-10-16 11:27 UTC253
96db497859dcatagen2026-10-16 11:27 UTC254
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
96db497859dcatagen2026-10-16 11:27 UTC255
pub enum Transition {
96db497859dcatagen2026-10-16 11:27 UTC256
    Move = 0,
96db497859dcatagen2026-10-16 11:27 UTC257
    Spawn = 1,
96db497859dcatagen2026-10-16 11:27 UTC258
    Close = 2,
96db497859dcatagen2026-10-16 11:27 UTC259
}
96db497859dcatagen2026-10-16 11:27 UTC260
96db497859dcatagen2026-10-16 11:27 UTC261
/// A window transition for the effect shader, with `progress` in [0, 1].
96db497859dcatagen2026-10-16 11:27 UTC262
#[derive(Clone, Copy, Debug, PartialEq)]
96db497859dcatagen2026-10-16 11:27 UTC263
pub struct Effect {
96db497859dcatagen2026-10-16 11:27 UTC264
    pub kind: Transition,
96db497859dcatagen2026-10-16 11:27 UTC265
    pub progress: f32,
96db497859dcatagen2026-10-16 11:27 UTC266
}