Skip to main content

euv_core/render/hardware/
enum.rs

1/// Unified 8-variant primitive kind encoded in `GpuPrimitiveInstance::kind_flags` bits `[0..4]`.
2#[repr(u8)]
3#[derive(Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
4pub enum PrimKind {
5    /// Solid or bordered rounded rectangle with analytic per-corner SDF anti-aliasing.
6    #[default]
7    RoundedRect = 0,
8    /// Two-stop linear gradient quad with arbitrary angle and rounded corner clip.
9    LinearGradientRect = 1,
10    /// Analytic Erf/Gaussian rounded-rect shadow SDF with interleaved gradient noise dither.
11    Shadow = 2,
12    /// Monochrome R8 coverage glyph atlas quad with premultiplied text tint.
13    GlyphAlpha8 = 3,
14    /// Full-color RGBA8 emoji or color-font glyph atlas quad.
15    GlyphColorRgba8 = 4,
16    /// Direct GPU image or sprite-sheet region texture quad with optional rounded corners.
17    ImageTexture = 5,
18    /// Analytic SDF anti-aliased vector shape (`Circle`, `Line`, or `Triangle`).
19    VectorShape = 6,
20    /// Shared-device external GPU surface (3D game render target or hardware video texture).
21    ExternalGpuSurface = 7,
22    /// Dual-Kawase GPU frosted-glass backdrop blur composite quad.
23    BackdropBlur = 8,
24}
25
26/// Analytic vector shape sub-kind encoded in `GpuPrimitiveInstance::kind_flags` bits `[4..6]` for `PrimKind::VectorShape`.
27#[repr(u8)]
28#[derive(Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
29pub enum VectorSubKind {
30    /// Analytic SDF anti-aliased filled circle.
31    #[default]
32    Circle = 0,
33    /// Analytic SDF anti-aliased capsule line segment.
34    Line = 1,
35    /// Analytic SDF anti-aliased filled triangle.
36    Triangle = 2,
37}
38
39/// Primitive kind discriminant encoded inside each `GpuQuadInstance`.
40#[derive(Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
41pub enum GpuPrimitiveKind {
42    /// Solid or bordered rounded rectangle.
43    #[default]
44    RoundedRect = 0,
45    /// Two-stop linear gradient quad.
46    Gradient = 1,
47    /// Analytical SDF box shadow quad.
48    Shadow = 2,
49    /// Textured glyph atlas quad.
50    Glyph = 3,
51    /// Textured RGBA image or hybrid tile quad.
52    TexturedQuad = 4,
53    /// Filled SDF circle quad.
54    Circle = 5,
55    /// Anti-aliased line segment quad.
56    Line = 6,
57    /// Filled triangle primitive quad.
58    Triangle = 7,
59    /// Backdrop blur sampling region quad.
60    BackdropBlur = 8,
61    /// External GPU render-target surface (3D or fluid shader pass).
62    ExternalSurface = 9,
63}