Skip to main content

euv_engine/raytracing/backend/data/
enum.rs

1use super::*;
2
3/// The rendering backend a [`RayTraceRenderer`] drives.
4///
5/// The backend is chosen by the caller at construction and is never
6/// substituted afterwards: a renderer that was asked for WebGPU reports
7/// an error when the GPU path fails instead of quietly drawing through
8/// Canvas 2D, because a silent substitution turns a diagnosable
9/// validation error into a silently slower frame with different pixels.
10#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)]
11pub enum RayTraceBackend {
12    /// The CPU reference path: the frame is traced on the CPU and blitted
13    /// through an `ImageData` upload.
14    #[default]
15    Canvas2D,
16    /// The WebGL 2 path: a fullscreen triangle samples two RGBA32F data
17    /// textures and writes the default framebuffer.
18    WebGl2,
19    /// The WebGPU path: a fullscreen triangle reads two storage buffers
20    /// through a bind group and writes the swap-chain texture.
21    WebGpu,
22}