Skip to main content

euv_example/app/
enum.rs

1/// Strict Web showcase presentation mode separating true GPU direct draw, WebGL2 CPU upload, and Canvas 2D fallback.
2#[derive(Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
3pub enum ShowcaseWebPresentationPath {
4    /// WebGL2 direct GPU primitive/uber-shader rendering (`cpu_mirror_active = false`).
5    GpuDirect,
6    /// WebGL2 uploading CPU-rasterized dirty rects (`precision highp float` + `texelFetch`, `cpu_mirror_active = true`).
7    #[default]
8    GpuUpload,
9    /// Canvas 2D `putImageData` software fallback (`cpu_mirror_active = true`).
10    Canvas2d,
11}
12
13/// Locked HTML5 `<canvas>` context family (a single `<canvas>` can NEVER bind both `WebGl2` and `Canvas2d`).
14#[derive(Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
15pub enum ShowcaseWebCanvasContextFamily {
16    /// Canvas locked to `webgl2` (`GpuDirect` or `GpuUpload`).
17    #[default]
18    WebGl2,
19    /// Canvas locked to `2d` (`Canvas2d` fallback).
20    Canvas2d,
21}
22
23/// Truthful browser presentation timing source for showcase rAF telemetry.
24#[derive(Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
25pub enum ShowcaseWebTimingSource {
26    /// Browser `requestAnimationFrame` callback timestamp used strictly as a submission proxy (NOT hardware compositor proof).
27    #[default]
28    SubmissionProxy,
29    /// Timing unavailable.
30    Unobservable,
31}