1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// SPDX-FileCopyrightText: 2026 Gianluca Boiano
// SPDX-FileCopyrightText: 2005-2013 Nullsoft, Inc.
// SPDX-License-Identifier: (MIT OR Apache-2.0) AND BSD-3-Clause
//! wgpu backend reproducing the MilkDrop 2 frame pipeline; host-provided device, renders into any texture.
//!
//! This crate is a port of MilkDrop 2's `CPlugin::RenderFrame` (milkdropfs.cpp) and the texture /
//! noise setup of plugin.cpp. It knows nothing about presets, expressions, HLSL or audio: the
//! engine evaluates a preset's equations, builds a [`FrameInput`] and calls
//! [`Renderer::render_frame`].
//!
//! Frame pipeline (all internal images `Rgba8Unorm`, never sRGB):
//!
//! 1. motion vectors are drawn onto the *previous* image (MD2 order),
//! 2. warp pass `prev -> next` (user warp shader, or `WarpedBlit_NoShaders`),
//! 3. blur chain from the previous image, only up to the highest level a shader uses,
//! 4. custom shapes, custom waves, main wave, darken-center, borders on `next`,
//! 5. composite `next -> final` (user comp shader on the 32x24 comp mesh, or
//! `ShowToUser_NoShaders`: video echo, gamma, brighten/darken/solarize/invert),
//! 6. blit `final` to the host target (sRGB-compensated if needed).
//!
//! With `Compat::MilkDrop2` / `Compat::MilkDrop3` the engine may hand over [`Md2Blend`] data (`FrameInput::md2_blend`): MilkDrop 2's own
//! preset blend, where steps 2, 4 and 5 run once or twice (old and new shader, alpha-tiled) on a blended warp mesh.
//!
//! Where MilkDrop 2 and projectM differ, [`Compat`] picks the behaviour (default projectM).
//!
//! # Features
//!
//! * `diagnostics` (off by default): reference-comparison hooks (image injection, extra read-backs).
// The pipeline is a port of MD2 / projectM code: their literals (`6.28`, `3.1415926535898`, ...) are deliberate and
// differ from the exact constants, the per-pass functions take the reference code's many parameters, and the loops
// index several parallel arrays the way the reference does.
// Test code builds `FrameInput`s field by field and walks pixel buffers in 4-byte chunks; clarity over lint style.
pub use ;
pub use ;
pub use ;
pub use Renderer;
pub use Rng;
pub use ShaderExt;
pub use ;
pub use ;
pub use RotParams;
pub use MeshGeometry;
pub use lactea_abi as abi;