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}
23
24/// Analytic vector shape sub-kind encoded in `GpuPrimitiveInstance::kind_flags` bits `[4..6]` for `PrimKind::VectorShape`.
25#[repr(u8)]
26#[derive(Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
27pub enum VectorSubKind {
28 /// Analytic SDF anti-aliased filled circle.
29 #[default]
30 Circle = 0,
31 /// Analytic SDF anti-aliased capsule line segment.
32 Line = 1,
33 /// Analytic SDF anti-aliased filled triangle.
34 Triangle = 2,
35}
36
37/// Primitive kind discriminant encoded inside each `GpuQuadInstance`.
38#[derive(Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
39pub enum GpuPrimitiveKind {
40 /// Solid or bordered rounded rectangle.
41 #[default]
42 RoundedRect = 0,
43 /// Two-stop linear gradient quad.
44 Gradient = 1,
45 /// Analytical SDF box shadow quad.
46 Shadow = 2,
47 /// Textured glyph atlas quad.
48 Glyph = 3,
49 /// Textured RGBA image or hybrid tile quad.
50 TexturedQuad = 4,
51 /// Filled SDF circle quad.
52 Circle = 5,
53 /// Anti-aliased line segment quad.
54 Line = 6,
55 /// Filled triangle primitive quad.
56 Triangle = 7,
57 /// Backdrop blur sampling region quad.
58 BackdropBlur = 8,
59}